9 #ifndef ThePEG_StringUtils_H 10 #define ThePEG_StringUtils_H 13 #include "ThePEG/Config/ThePEG.h" 35 static StringVector
split(
string s,
string ws =
" \t\r\n");
42 static string car(
string s,
string ws =
" \t\r\n");
49 static string cdr(
string s,
string ws =
" \t\r\n");
55 static string stripws(
string str);
62 static string dirname(
string file);
73 static string remsuf(
string file);
79 static string suffix(
string file);
87 static map<string,string>
xmlAttributes(
string tag,
string line,
88 string::size_type curr = 0);
94 static string typeName(
const type_info & t);
99 typedef string::size_type
pos_t;
104 static const pos_t
end = string::npos;
static string cdr(string s, string ws=" \t\r\n")
Return s after removing the first substring, defined by the separating characters in ws (the ws chara...
static StringVector split(string s, string ws=" \t\r\n")
Return a vector of string containing the substrings of s, defined by the separating characters in ws ...
static string basename(string file)
Return the base name of the given filename, removing the directory path if present.
This is the main namespace within which all identifiers in ThePEG are declared.
The StringUtils class contains a few static utility functions for basic strings.
static string stripws(string str)
Return the string str stripped from leading and trailing white space.
static string typeName(const type_info &t)
Try to return a human-readable class name given a type_info object.
static const pos_t end
Convenient alias for npos.
string::size_type pos_t
Convenient typdef.
static string suffix(string file)
Return the trailing suffix (without the dot) of the given filename.
static map< string, string > xmlAttributes(string tag, string line, string::size_type curr=0)
Assuming the line contains a valid XML tag, scan the line for attributes belonging to this tag and re...
static string car(string s, string ws=" \t\r\n")
Return the first substring of s, defined by the separating characters in ws (the ws characters are no...
static string dirname(string file)
Return the directory path part (excluding the trailing slash) of the given filename, or an empty string if no directory path is included.
vector< string > StringVector
A vector of strings.
static string remsuf(string file)
Remove the trailing suffix from the given filename.