Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Utilities Class Reference

#include <Utilities.h>

List of all members.

Static Public Methods

string entityReferences (const string &s)
string trim (const string &s)
 remove the trailing spaces from string s if there are some. More...

vector<string> splitString (const string &s, char c)
 split a string by unescaped char. More...

string escapeChar (const string &s, char c)
 escape all char c in string s. More...


Detailed Description

Utilities class defines some commonly used functions. Utilities class defines some commonly used functions, such as trim, escapeChar, etc. All the functions are static.
Author(s):
Xiaoyi Ma


Member Function Documentation

string Utilities::entityReferences ( const string & s ) [static]
 

entityReferences converts the special characters in a string to their entity references so that the string can be a legal HTML or XML string. Certain characters, such as the left bracket (<), ampersand (&), etc. are reserved by HTML, SGML and XML to represent special attributes such as the start of HTML elements, graphic characters, and so on.

HTML allows special referencing to represent these special characters. These are indicated by either character references or entity references.

Entity references use symbolic names to represent the characters. Entity references have three parts:

   1. a leading ampersand character, (&), 
   2. the name of the entity (in ascii characters) 
   3. a terminating semicolon (;). 
 
Thus the entity reference for less than symbol (<) is &lt;.
See also:
http://www.w3c.org for details.

string Utilities::escapeChar ( const string & s,
char c ) [static]
 

escape all char c in string s.

vector< string > Utilities::splitString ( const string & s,
char c ) [static]
 

split a string by unescaped char.

string Utilities::trim ( const string & s ) [static]
 

remove the trailing spaces from string s if there are some.


The documentation for this class was generated from the following file:
Generated at Wed Jul 3 14:56:03 2002 for Annotation Graph API by doxygen1.2.7 written by Dimitri van Heesch, © 1997-2001