stringUtils Class Reference

Miscellaneous functions related to strings. More...

List of all members.

Static Public Member Functions

static bool isStringEqualNoCase (const string &s1, const char *s2, const string::size_type n)
static bool isStringEqualNoCase (const string &s1, const string &s2)
static bool isStringEqualNoCase (const string::const_iterator begin, const string::const_iterator end, const char *s, const string::size_type n)
static const string toLower (const string &str)
static const string toUpper (const string &str)
static const string trim (const string &str)
static string::size_type countASCIIchars (const string::const_iterator begin, const string::const_iterator end)
template<class TYPE >
static const string toString (const TYPE &value)
template<class TYPE >
static const TYPE fromString (const string &value)
static const string unquote (const string &str)

Detailed Description

Miscellaneous functions related to strings.


Member Function Documentation

string::size_type countASCIIchars ( const string::const_iterator  begin,
const string::const_iterator  end 
) [static]

Return the number of 7-bit US-ASCII characters in a string.

Parameters:
begin start position
end end position
Returns:
number of ASCII characters

References vmime::count(), and parserHelpers::isAscii().

Referenced by text::createFromString().

static const TYPE fromString ( const string value  )  [static]

Convert the specified string value to a value of the specified type.

Parameters:
value value to convert
Returns:
value converted into type 'TYPE'
bool isStringEqualNoCase ( const string::const_iterator  begin,
const string::const_iterator  end,
const char *  s,
const string::size_type  n 
) [static]

Test two strings for equality (case insensitive).

Warning:
Use this with ASCII-only strings.
Parameters:
begin start position of the first string
end end position of the first string
s second string (must be in lower-case!)
n length of the second string
Returns:
true if the two strings compare equally, false otherwise
bool isStringEqualNoCase ( const string s1,
const string s2 
) [static]

Test two strings for equality (case insensitive).

Warning:
Use this with ASCII-only strings.
Parameters:
s1 first string
s2 second string
Returns:
true if the two strings compare equally, false otherwise

References vmime::end().

bool isStringEqualNoCase ( const string s1,
const char *  s2,
const string::size_type  n 
) [static]

Test two strings for equality (case insensitive).

Warning:
Use this with ASCII-only strings.
Parameters:
s1 first string
s2 second string (must be in lower-case!)
n length of the second string
Returns:
true if the two strings compare equally, false otherwise

Referenced by relay::parse().

const string toLower ( const string str  )  [static]
static const string toString ( const TYPE &  value  )  [static]

Convert the specified value to a string value.

Parameters:
value to convert
Returns:
value converted from type 'TYPE'
const string toUpper ( const string str  )  [static]

Transform all the characters in a string to upper-case.

Warning:
Use this with ASCII-only strings.
Parameters:
str the string to transform
Returns:
a new string in upper-case

Referenced by SASLMechanismFactory::create().

const string trim ( const string str  )  [static]

Strip the space characters (SPC, TAB, CR, LF) at the beginning and at the end of the specified string.

Parameters:
str string in which to strip spaces
Returns:
a new string with space characters removed

References parserHelpers::isSpace().

Referenced by maildirStore::isValidFolderName(), mediaType::parse(), and encoding::parse().

const string unquote ( const string str  )  [static]

Unquote the specified string and transform escaped characters.

Parameters:
string from which to remove quotes
Returns:
unquoted string

Referenced by encoding::parse().


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2