StrUtil Class: String Manipulation Utilities.
More...
#include <StrUtil.H>
|
static string | parse (const string &text, const map< string, string, less< string > > &to_parse, string tag_begin, string tag_end) |
| Used for parsing XML Templates. More...
|
|
static int | gsub (string &buffer, const char *pat, const char *drp) |
| Used for substitution of pat for drp within buffer. More...
|
|
template<class kind > |
static string | to_string (const char *format, const kind &number) |
| Convert number to string where the format string looks like printf format. More...
|
|
static int | iso88591_to_utf8 (const string &iso88591, string &utf8) |
|
static int | utf8_to_iso88591 (const string &utf8, string &iso88591) |
|
static string | esc_xml_markup (const string &input_txt) |
| Escape &'><" characters. More...
|
|
static string & | ltrim (string &s) |
| Trim from start. More...
|
|
static string & | rtrim (string &s) |
| Trim from end. More...
|
|
static string & | trim (string &s) |
| Trim from both ends. More...
|
|
StrUtil Class: String Manipulation Utilities.
static string StrUtil::esc_xml_markup |
( |
const string & |
input_txt | ) |
|
|
static |
static int StrUtil::gsub |
( |
string & |
buffer, |
|
|
const char * |
pat, |
|
|
const char * |
drp |
|
) |
| |
|
static |
Used for substitution of pat for drp within buffer.
- Parameters
-
buffer | Text to be scanned |
pat | Pattern to be substituted |
drp | Substitute for the pattern indicated by pat |
- Returns
- Number of matches
Referenced by SheppStrUtil::doc2id().
static int StrUtil::iso88591_to_utf8 |
( |
const string & |
iso88591, |
|
|
string & |
utf8 |
|
) |
| |
|
static |
Encodes an ISO-8859-1 string to UTF-8. ISO-8859-1 non-printable characters are substituted by spaces (ASCII 0x20).
- Parameters
-
iso88591 | ISO-8859-1 string to be encoded to UTF-8 |
utf8 | UTF-8 encodeded string |
- Returns
- number of characters substituted by spaces
Referenced by cmd_xmlcmd().
static string& StrUtil::ltrim |
( |
string & |
s | ) |
|
|
static |
Trim from start.
- Parameters
-
- Returns
- left trimmed string
static string StrUtil::parse |
( |
const string & |
text, |
|
|
const map< string, string, less< string > > & |
to_parse, |
|
|
string |
tag_begin, |
|
|
string |
tag_end |
|
) |
| |
|
static |
Used for parsing XML Templates.
- Parameters
-
text | XML template to be parsed |
to_parse | Mapping tags into values |
tag_begin | Symbol for begin tag |
tag_end | Symbol for end tag |
- Returns
- Parsed string
Referenced by Action::set_xml_template_common().
static string& StrUtil::rtrim |
( |
string & |
s | ) |
|
|
static |
Trim from end.
- Parameters
-
- Returns
- right trimmed string
template<class kind >
static string StrUtil::to_string |
( |
const char * |
format, |
|
|
const kind & |
number |
|
) |
| |
|
inlinestatic |
static string& StrUtil::trim |
( |
string & |
s | ) |
|
|
static |
static int StrUtil::utf8_to_iso88591 |
( |
const string & |
utf8, |
|
|
string & |
iso88591 |
|
) |
| |
|
static |
Decodes a UTF-8 string to ISO-8859-1. ISO-8859-1 non-printable characters and not ISO-8859-1 characters are substituted by spaces (ASCII 0x20).
- Parameters
-
utf8 | UTF-8 encoded string to be decoded |
iso88591 | decoded ISO-8859-1 string |
- Returns
- number of characters substituted by spaces
string StrUtil::xml_beautifier |
( |
const string & |
input_txt | ) |
|
XML Beautifier.
- Parameters
-
input_txt | The text to be formatted (in UTF-8) |
- Returns
- The indented XML document
Referenced by cmd_xmlcmd(), and cmd_xmlrsp().
The documentation for this class was generated from the following file: