String Class Reference

#include <String.h>

Inherits std::string.

Inheritance diagram for String:

Inheritance graph
[legend]
Collaboration diagram for String:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 String ()
 String (const char *str)
 String (const string &str)
 String (const char *format, va_list args)
 String (const unsigned int size, const char fill)
 String (const char *data, unsigned int size)
virtual ~String ()
StringtoLower ()
StringtoUpper ()
Stringmd5 ()
StringsetNum (const int i, const NumberBase base=BASE_DEC)
StringsetNum (const unsigned int i, NumberBase base=BASE_DEC)
StringsetNum (const long long i, const NumberBase base=BASE_DEC)
StringsetNum (const unsigned long long i, const NumberBase base=BASE_DEC)
StringsetNum (const double d)
StringsetBool (const bool b)
Stringsprintf (const char *format,...) __attribute__((format(printf
String Stringvsprintf (const char *format, va_list args)
bool isTrue () const
int toInt (int &n) const
int toUint (unsigned int &n) const
int toLongLong (long long &n) const
int toDouble (double &n) const
Stringtrim (const bool asciiOnly=false)
StringreplaceCtrlChars (const char replacement= ' ')
StringreplaceChar (const char oldChar, const char newChar= ' ')
StringreplaceSubStr (const string &oldStr, const string &newStr="")
Stringalign (const unsigned int width=STRING_DEFAULT_LINE_WIDTH, const Alignment al=ALIGN_JUSTIFY)
bool contains (const String &str, const bool ignoreCase=false) const
Stringintersection (const String &str, const bool ignoreCase=false)
bool equals (const String &str, const bool ignoreCase=false) const
Stringcolorize (const String &fgColor=CONSOLE_COLOR_FG_WHITE, const String &bgColor=CONSOLE_COLOR_BG_NONE)
unsigned int colorLength () const
StringparseXml ()

Static Public Member Functions

static String toLower (const String &str)
static String toUpper (const String &str)
static String md5 (const String &str)
static const char * eol ()
static String number (const int i, const NumberBase base=BASE_DEC)
static String number (const unsigned int i, const NumberBase base=BASE_DEC)
static String number (const long long i, const NumberBase base=BASE_DEC)
static String number (const unsigned long long i, const NumberBase base=BASE_DEC)
static String number (const double d)
static String boolean (const bool b)
static bool isTrue (const String &str)
static String timestamp ()
static String colorize (const String &str, const String &fgColor=CONSOLE_COLOR_FG_WHITE, const String &bgColor=CONSOLE_COLOR_BG_NONE)
static int setColorEnabled (const bool yes=true)
static String parseXml (const String &xmlStr)
static unsigned int colorLength (const char *str)

Static Private Attributes

static bool _colorEnabled

Detailed Description

Definition at line 99 of file String.h.


Constructor & Destructor Documentation

String::String (  ) 

Definition at line 27 of file String.cpp.

Referenced by colorize(), and parseXml().

String::String ( const char *  str  ) 

Definition at line 31 of file String.cpp.

String::String ( const string &  str  ) 

Definition at line 35 of file String.cpp.

String::String ( const char *  format,
va_list  args 
)

Definition at line 39 of file String.cpp.

References vsprintf().

String::String ( const unsigned int  size,
const char  fill 
)

Definition at line 44 of file String.cpp.

String::String ( const char *  data,
unsigned int  size 
)

Definition at line 48 of file String.cpp.

String::~String (  )  [virtual]

Definition at line 56 of file String.cpp.


Member Function Documentation

String & String::toLower (  ) 

Definition at line 127 of file String.cpp.

Referenced by RegistryBase::ajustName(), and isTrue().

String String::toLower ( const String str  )  [static]

Definition at line 136 of file String.cpp.

String & String::toUpper (  ) 

Definition at line 146 of file String.cpp.

String String::toUpper ( const String str  )  [static]

Definition at line 155 of file String.cpp.

String & String::md5 (  ) 

Definition at line 165 of file String.cpp.

Referenced by Inetd::authorize().

String String::md5 ( const String str  )  [static]

Definition at line 171 of file String.cpp.

References sprintf().

String & String::setNum ( const int  i,
const NumberBase  base = BASE_DEC 
)

Definition at line 186 of file String.cpp.

References number().

Referenced by S11n< T >::toString().

String & String::setNum ( const unsigned int  i,
NumberBase  base = BASE_DEC 
)

Definition at line 192 of file String.cpp.

References number().

String & String::setNum ( const long long  i,
const NumberBase  base = BASE_DEC 
)

Definition at line 198 of file String.cpp.

References number().

String & String::setNum ( const unsigned long long  i,
const NumberBase  base = BASE_DEC 
)

Definition at line 204 of file String.cpp.

References number().

String & String::setNum ( const double  d  ) 

Definition at line 210 of file String.cpp.

References number().

String & String::setBool ( const bool  b  ) 

Definition at line 216 of file String.cpp.

Referenced by S11n< T >::toString().

String & String::sprintf ( const char *  format,
  ... 
)

Definition at line 60 of file String.cpp.

References vsprintf().

Referenced by Timer::list(), Object::listInstances(), Object::listMyRegistry(), Object::listMySignals(), Object::listObjects(), Object::listRegistry(), Core::listServices(), Object::listSignals(), Timer::listSingleShot(), SignalBase::listSlots(), Object::listTop(), md5(), number(), and BrowserWindow::updateStatusBar().

String & String::vsprintf ( const char *  format,
va_list  args 
)

Definition at line 70 of file String.cpp.

References ERROR, MEM_ALLOC, MEM_FREE, MSG_MEMORY_CANNOT_ALLOCATE, MSG_NULL_POINTER, MSG_STRING_PRINTF, MSG_STRING_TOO_BIG, STRING_PRINTF_INIT_SIZE, and STRING_PRINTF_MAX_SIZE.

Referenced by sprintf(), String(), and Connection::vprintf().

bool String::isTrue (  )  const

Definition at line 222 of file String.cpp.

Referenced by S11n< T >::fromString().

int String::toInt ( int &  n  )  const

Definition at line 227 of file String.cpp.

References ERROR, MSG_STRING_CANNOT_CONVERT, and OK.

Referenced by S11n< T >::fromString().

int String::toUint ( unsigned int &  n  )  const

Definition at line 238 of file String.cpp.

References ERROR, MSG_STRING_CANNOT_CONVERT, and OK.

Referenced by S11n< T >::fromString(), and S11n< T >::fromXml().

int String::toLongLong ( long long &  n  )  const

Definition at line 249 of file String.cpp.

References ERROR, MSG_STRING_CANNOT_CONVERT, and OK.

Referenced by S11n< T >::fromString().

int String::toDouble ( double &  n  )  const

Definition at line 260 of file String.cpp.

References ERROR, MSG_STRING_CANNOT_CONVERT, and OK.

Referenced by S11n< T >::fromString().

String & String::trim ( const bool  asciiOnly = false  ) 

Definition at line 271 of file String.cpp.

Referenced by XmlElement::appendInnerData(), Inetd::authorize(), and XmlElement::setInnerData().

String & String::replaceCtrlChars ( const char  replacement = ' '  ) 

Definition at line 295 of file String.cpp.

String & String::replaceChar ( const char  oldChar,
const char  newChar = ' ' 
)

Definition at line 306 of file String.cpp.

String & String::replaceSubStr ( const string &  oldStr,
const string &  newStr = "" 
)

Definition at line 317 of file String.cpp.

Referenced by RegistryBase::ajustName().

String & String::align ( const unsigned int  width = STRING_DEFAULT_LINE_WIDTH,
const Alignment  al = ALIGN_JUSTIFY 
)

Definition at line 329 of file String.cpp.

References ALIGN_CENTER, ALIGN_JUSTIFY, ALIGN_RIGHT, colorLength(), eol(), ERROR_BACKTRACE(), FAILED(), and Parser::split().

bool String::contains ( const String str,
const bool  ignoreCase = false 
) const

Definition at line 411 of file String.cpp.

References CSTRING().

String & String::intersection ( const String str,
const bool  ignoreCase = false 
)

Definition at line 416 of file String.cpp.

References MIN().

Referenced by FShGetLine::onTab().

bool String::equals ( const String str,
const bool  ignoreCase = false 
) const

Definition at line 436 of file String.cpp.

Referenced by XmlDocument::_getElementsByName(), XmlDocument::_getElementsByTagName(), Inetd::authorize(), XmlDocument::createElement(), S11n< T >::fromXml(), and NamedObject::get().

String & String::colorize ( const String fgColor = CONSOLE_COLOR_FG_WHITE,
const String bgColor = CONSOLE_COLOR_BG_NONE 
)

Definition at line 456 of file String.cpp.

unsigned int String::colorLength (  )  const

Definition at line 468 of file String.cpp.

Referenced by align(), and FShGetLine::onStrlen().

String & String::parseXml (  ) 

Definition at line 462 of file String.cpp.

const char * String::eol (  )  [static]

Definition at line 487 of file String.cpp.

Referenced by XmlElement::_toString(), align(), Inetd::authorize(), Timer::list(), Object::listInstances(), Object::listMyRegistry(), Object::listMySignals(), Object::listObjects(), Object::listRegistry(), Core::listServices(), Object::listSignals(), Timer::listSingleShot(), SignalBase::listSlots(), Object::listTop(), FShGetLine::onOutput(), FShGetLine::onTab(), and Connection::writeLn().

String String::number ( const int  i,
const NumberBase  base = BASE_DEC 
) [static]

Definition at line 492 of file String.cpp.

References BASE_HEX, BASE_OCT, and sprintf().

Referenced by Inetd::Inetd(), setNum(), S11n< T >::toString(), and S11n< T >::toXml().

String String::number ( const unsigned int  i,
const NumberBase  base = BASE_DEC 
) [static]

Definition at line 510 of file String.cpp.

References BASE_HEX, BASE_OCT, and sprintf().

String String::number ( const long long  i,
const NumberBase  base = BASE_DEC 
) [static]

Definition at line 528 of file String.cpp.

References BASE_HEX, BASE_OCT, and sprintf().

String String::number ( const unsigned long long  i,
const NumberBase  base = BASE_DEC 
) [static]

Definition at line 546 of file String.cpp.

References BASE_HEX, BASE_OCT, and sprintf().

String String::number ( const double  d  )  [static]

Definition at line 564 of file String.cpp.

References sprintf().

String String::boolean ( const bool  b  )  [static]

Definition at line 572 of file String.cpp.

bool String::isTrue ( const String str  )  [static]

Definition at line 577 of file String.cpp.

References toLower().

String String::timestamp (  )  [static]

Definition at line 585 of file String.cpp.

Referenced by Error::errorFatal(), Error::info(), Error::verror(), and Error::warning().

String String::colorize ( const String str,
const String fgColor = CONSOLE_COLOR_FG_WHITE,
const String bgColor = CONSOLE_COLOR_BG_NONE 
) [static]

Definition at line 601 of file String.cpp.

References _colorEnabled, CONSOLE_COLOR_ECHO_ESCAPE, CONSOLE_COLOR_REGULAR, and String().

int String::setColorEnabled ( const bool  yes = true  )  [static]

Definition at line 606 of file String.cpp.

References _colorEnabled, and OK.

String String::parseXml ( const String xmlStr  )  [static]

Definition at line 612 of file String.cpp.

References _colorEnabled, CONSOLE_COLOR_ECHO_ESCAPE, CONSOLE_COLOR_REGULAR, CSTRING(), MSG_STRING_MALFORMED_XML, StringColorTag::name, String(), STRING_COLOR_TAGS, and WARNING.

unsigned int String::colorLength ( const char *  str  )  [static]

Definition at line 634 of file String.cpp.


Member Data Documentation

bool String::_colorEnabled [static, private]

Definition at line 170 of file String.h.

Referenced by colorize(), parseXml(), and setColorEnabled().


The documentation for this class was generated from the following files:
Generated on Thu Sep 6 20:13:55 2007 for Pylon Application Platform by  doxygen 1.5.1