#include <DomString.h>
DomString
represents a unicode string which is used for all DOM operations.
The string supports conversion from Latin1 (ISO-8859-1) 8-bit encoding into unicode and back. But converting unicode into any 8-bit encinding can result in data loss, because characters which can not be converted are dopped.
Public Member Functions | |
DomString () | |
Create an empty string. | |
DomString (const std::string &latin1String) | |
Create a string from a std latin1 string. | |
DomString (const char *latin1String) | |
Create a string from a latin1 string. | |
DomString (const std::wstring &wcharString) | |
Create a string from a std wide character string. | |
DomString (const wchar_t *wcharString) | |
Create a string from a wchar_t string. | |
DomString (const DomString ©) | |
copy ctor | |
virtual | ~DomString () |
dtor | |
const DomString & | operator= (const DomString &assign) |
assignment | |
unsigned int | getLength () const |
Get the length of this string. | |
std::string | toLatin1 () const |
Convert this string into a latin1 string. | |
std::wstring | toWCharString () const |
Convert this string into a wchar_t string. | |
bool | isNull () const |
Check if this is a "null" string. | |
bool | operator== (const DomString &compare) const |
Compare this string with another one. | |
bool | operator!= (const DomString &compare) const |
Compare this string with another one. |
xmldom::DomString::DomString | ( | ) |
Create an empty string.
xmldom::DomString::DomString | ( | const std::string & | latin1String | ) |
Create a string from a std latin1 string.
xmldom::DomString::DomString | ( | const char * | latin1String | ) |
Create a string from a latin1 string.
This is a helper function which is calling DomString( std::string( latin1String ) )
internally.
xmldom::DomString::DomString | ( | const std::wstring & | wcharString | ) |
Create a string from a std wide character string.
The format of a wchar_t string is depending on the platform, but the conversion should work as expected.
xmldom::DomString::DomString | ( | const wchar_t * | wcharString | ) |
Create a string from a wchar_t string.
This helper function simply converts the wchar_t
string with DomString( std::wstring( wcharString ) )
.
xmldom::DomString::DomString | ( | const DomString & | copy | ) |
copy ctor
xmldom::DomString::~DomString | ( | ) | [virtual] |
dtor
unsigned int xmldom::DomString::getLength | ( | ) | const |
Get the length of this string.
std::string xmldom::DomString::toLatin1 | ( | ) | const |
Convert this string into a latin1 string.
std::wstring xmldom::DomString::toWCharString | ( | ) | const |
Convert this string into a wchar_t string.
The format of a wchar_t string is depending on the platform, but the conversion should work as expected.
bool xmldom::DomString::isNull | ( | ) | const |
Check if this is a "null" string.
A "null" string has not the same meaning as a empty string. But the behavior is in the most cases the same.
bool xmldom::DomString::operator== | ( | const DomString & | compare | ) | const |
Compare this string with another one.
If one string is a "null" string the result is always false. Only if both strings are "null" strings the result is true.
bool xmldom::DomString::operator!= | ( | const DomString & | compare | ) | const |
Compare this string with another one.
If one string is a "null" string the result is always true. Only if both strings are "null" strings the result is false.