ThePEG  1.8.0
StringUtils.h
1 // -*- C++ -*-
2 //
3 // StringUtils.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_StringUtils_H
10 #define ThePEG_StringUtils_H
11 // This is the declaration of the StringUtils class.
12 
13 #include "ThePEG/Config/ThePEG.h"
14 
15 namespace ThePEG {
16 
21 class StringUtils {
22 
23 public:
24 
28  typedef vector<string> StringVector;
29 
35  static StringVector split(string s, string ws = " \t\r\n");
36 
42  static string car(string s, string ws = " \t\r\n");
43 
49  static string cdr(string s, string ws = " \t\r\n");
50 
55  static string stripws(string str);
56 
62  static string dirname(string file);
63 
68  static string basename(string file);
69 
73  static string remsuf(string file);
74 
79  static string suffix(string file);
80 
87  static map<string,string> xmlAttributes(string tag, string line,
88  string::size_type curr = 0);
89 
94  static string typeName(const type_info & t);
95 
99  typedef string::size_type pos_t;
100 
104  static const pos_t end = string::npos;
105 
106 
107 };
108 
109 }
110 
111 #endif /* ThePEG_StringUtils_H */