StrUtil Class: String Manipulation Utilities. More...
#include <StrUtil.H>
Public Member Functions | |
string | xml_beautifier (const string &input_txt) |
XML Beautifier. | |
Static Public Member Functions | |
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. | |
static int | gsub (string &buffer, const char *pat, const char *drp) |
Used for substitution of pat for drp within buffer. | |
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. | |
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. |
StrUtil Class: String Manipulation Utilities.
static string StrUtil::esc_xml_markup | ( | const string & | input_txt | ) | [static] |
Escape &'><" characters.
input_txt | The text that will possibly have some characters escaped |
Referenced by DSInfo::get_xml_format(), and Action::set_xml_template_common().
static int StrUtil::gsub | ( | string & | buffer, | |
const char * | pat, | |||
const char * | drp | |||
) | [static] |
Used for substitution of pat for drp within buffer.
buffer | Text to be scanned | |
pat | Pattern to be substituted | |
drp | Substitute for the pattern indicated by pat |
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).
iso88591 | ISO-8859-1 string to be encoded to UTF-8 | |
utf8 | UTF-8 encodeded string |
Referenced by cmd_xmlcmd().
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.
text | XML template to be parsed | |
to_parse | Mapping tags into values | |
tag_begin | Symbol for begin tag | |
tag_end | Symbol for end tag |
Referenced by Action::set_xml_template_common().
static string StrUtil::to_string | ( | const char * | format, | |
const kind & | number | |||
) | [inline, static] |
Convert number to string where the format string looks like printf format.
format | the format string in the printf format | |
number | the number to be converted |
Referenced by DSInfo::get_xml_format(), and Action::set_xml_template_common().
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).
utf8 | UTF-8 encoded string to be decoded | |
iso88591 | decoded ISO-8859-1 string |
string StrUtil::xml_beautifier | ( | const string & | input_txt | ) |
XML Beautifier.
input_txt | The text to be formatted (in UTF-8) |
Referenced by cmd_xmlcmd(), and cmd_xmlrsp().