StrUtil Class Reference

StrUtil Class: String Manipulation Utilities. More...

#include <StrUtil.H>

List of all members.

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)


Detailed Description

StrUtil Class: String Manipulation Utilities.


Member Function Documentation

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

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

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

template<class kind>
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.

Parameters:
format the format string in the printf format
number the number to be converted
Returns:
the string containing the number

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


The documentation for this class was generated from the following file:
Generated on Thu Jun 8 17:40:01 2006 for libepp_nicbr by  doxygen 1.4.6