ThePEG 2.3.0
|
The StringUtils class contains a few static utility functions for basic strings. More...
#include <StringUtils.h>
Public Types | |
typedef vector< string > | StringVector |
A vector of strings. | |
typedef string::size_type | pos_t |
Convenient typdef. | |
Static Public Member Functions | |
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 (the ws characters are not included in the substrings. | |
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 not included in the substrings. | |
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 characters are not included in the substrings. | |
static string | stripws (string str) |
Return the string str stripped from leading and trailing white space. | |
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. | |
static string | basename (string file) |
Return the base name of the given filename, removing the directory path if present. | |
static string | remsuf (string file) |
Remove the trailing suffix from the given filename. | |
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 return a map of name-value pairs. | |
static string | typeName (const type_info &t) |
Try to return a human-readable class name given a type_info object. | |
static string | replace (string original, string from, string to) |
Replace all occurences of the substring 'from' with the substring 'to' in the string 'original' and return the new string. | |
Static Public Attributes | |
static const pos_t | end = string::npos |
Convenient alias for npos. | |
The StringUtils class contains a few static utility functions for basic strings.
Definition at line 21 of file StringUtils.h.
typedef string::size_type ThePEG::StringUtils::pos_t |
Convenient typdef.
Definition at line 105 of file StringUtils.h.
typedef vector<string> ThePEG::StringUtils::StringVector |
A vector of strings.
Definition at line 28 of file StringUtils.h.
|
static |
Try to return a human-readable class name given a type_info object.
Currently only works for simple classes compiled by g++.
|
static |
Assuming the line contains a valid XML tag, scan the line for attributes belonging to this tag and return a map of name-value pairs.
Oprionally only look from position curr in the line.
|
static |
Convenient alias for npos.
Definition at line 110 of file StringUtils.h.