#include <String.h>
Inherits std::string.
Inheritance diagram for String:


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 () |
| String & | toLower () |
| String & | toUpper () |
| String & | md5 () |
| String & | setNum (const int i, const NumberBase base=BASE_DEC) |
| String & | setNum (const unsigned int i, NumberBase base=BASE_DEC) |
| String & | setNum (const long long i, const NumberBase base=BASE_DEC) |
| String & | setNum (const unsigned long long i, const NumberBase base=BASE_DEC) |
| String & | setNum (const double d) |
| String & | setBool (const bool b) |
| String & | sprintf (const char *format,...) __attribute__((format(printf |
| String String & | vsprintf (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 |
| String & | trim (const bool asciiOnly=false) |
| String & | replaceCtrlChars (const char replacement= ' ') |
| String & | replaceChar (const char oldChar, const char newChar= ' ') |
| String & | replaceSubStr (const string &oldStr, const string &newStr="") |
| String & | align (const unsigned int width=STRING_DEFAULT_LINE_WIDTH, const Alignment al=ALIGN_JUSTIFY) |
| bool | contains (const String &str, const bool ignoreCase=false) const |
| String & | intersection (const String &str, const bool ignoreCase=false) |
| bool | equals (const String &str, const bool ignoreCase=false) const |
| String & | colorize (const String &fgColor=CONSOLE_COLOR_FG_WHITE, const String &bgColor=CONSOLE_COLOR_BG_NONE) |
| unsigned int | colorLength () const |
| String & | parseXml () |
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 |
Definition at line 99 of file String.h.
| String::String | ( | ) |
| 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 | |||
| ) |
| 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.
| String & String::toLower | ( | ) |
Definition at line 136 of file String.cpp.
| String & String::toUpper | ( | ) |
Definition at line 146 of file String.cpp.
Definition at line 155 of file String.cpp.
| String & String::md5 | ( | ) |
| 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 | |||
| ) |
| String & String::setNum | ( | const long long | i, | |
| const NumberBase | base = BASE_DEC | |||
| ) |
| String & String::setNum | ( | const unsigned long long | i, | |
| const NumberBase | base = BASE_DEC | |||
| ) |
| String & String::setNum | ( | const double | d | ) |
| 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 |
| 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().
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 = "" | |||
| ) |
| 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().
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 |
| 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] |
| String String::number | ( | const long long | i, | |
| const NumberBase | base = BASE_DEC | |||
| ) | [static] |
| String String::number | ( | const unsigned long long | i, | |
| const NumberBase | base = BASE_DEC | |||
| ) | [static] |
| String String::number | ( | const double | d | ) | [static] |
Definition at line 572 of file String.cpp.
| 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 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.
bool String::_colorEnabled [static, private] |
Definition at line 170 of file String.h.
Referenced by colorize(), parseXml(), and setColorEnabled().
1.5.1