Public Member Functions | |
NString (void) | |
Constructs an empty NString object. | |
NString (const char *str) | |
Constructs a NString object setting it to str. | |
NString (const NString &str) | |
Constructs a NString object setting it to str. | |
~NString (void) | |
Destroys a NString object releasing the used memory. | |
NString & | set (const char *str) |
Sets the string of the current object. | |
NString & | set (const NString &str) |
Sets the string of the current object. | |
const char * | toChar () const |
Converts the string stored by the current object to a char pointer. | |
unsigned int | length () const |
The current lenght of the string. | |
bool | isNull () const |
Checks whether the current string is null (empty). | |
NString & | append (const char *str, nuint32 bytes) |
Appends a string to the current object. | |
NString & | append (const char *str) |
Appends a string to the current object. | |
NString & | append (const NString &str) |
Appends a string to the current object. | |
NString & | append (char c) |
Appends a char to the current object. | |
NString & | insert (nuint32 pos, nuint32 size, const NString str) |
Inserts a string at a given position in the string. | |
NString & | insert (nuint32 pos, const NString str) |
Inserts a string at a given position in the string. | |
bool | compare (nuint32 pos, nuint32 size, const NString &str) const |
Compare the string. | |
bool | compare (nuint32 pos, const NString &str) const |
Compare the string. | |
bool | compare (nuint32 pos, nuint32 size, const NString &str, nuint32 str_pos) const |
Compare the string. | |
NString | substr (nuint32 pos, nuint32 size) const |
Gets a substring. | |
nint32 | find (const NString &str, nuint32 pos, nuint32 ocur) const |
Finds a substring starting from a given position. | |
nint32 | find (const NString &str, nuint32 pos) const |
Finds a substring starting from a given position. | |
nint32 | find (const NString &str) const |
Finds a substring. | |
NString & | replace_first (const NString &src, const NString &dest) |
Replaces the first ocurrence of 'src' with 'dest'. | |
NString & | replace (const NString &src, const NString &dest) |
Replaces part of the string. | |
NString & | replace (const NString &src, const NString &dest, nuint32 ocur) |
Replaces part of the string. | |
NList< NString > | split (const NString &substr) |
Splits the string. | |
NString | operator+ (const char *str) |
Appends a string to the current object. | |
NString | operator+ (const NString &str) |
Appends a string to the current object. | |
NString | operator+ (char c) |
Appends a char to the current object. | |
NString & | operator+= (const char *str) |
Appends a string to the current object. | |
NString & | operator+= (const NString &str) |
Appends a string to the current object. | |
NString & | operator+= (char c) |
Appends a char to the current object. | |
char | operator[] (unsigned int index) const |
Access the char at position index. | |
bool | operator== (const NString &str) const |
Checks whether the current object is equals str. | |
bool | operator!= (const NString &str) const |
Checks whether the current object is not equal to str. | |
bool | operator> (const NString &str) const |
Checks whether the current object is lexically greater than str. | |
bool | operator< (const NString &str) const |
Checks whether the current object is lexically less than str. | |
bool | operator>= (const NString &str) const |
Checks whether the current object is lexically greater than or equals str. | |
bool | operator<= (const NString &str) const |
Checks whether the current object is lexically less than or equals str. | |
NString & | operator= (const NString &str) |
Sets the string of the current object. | |
NString & | arg (const char *fmt,...) |
Provides formatted output to a NString object. | |
Static Public Member Functions | |
static NString | number (int num) |
Converts a given number to a NString. | |
static NString | number (nint64 num) |
Converts a given number to a NString. | |
Static Public Attributes | |
static const nint32 | NOT_FOUND = -1 |
clientapp.cpp, ex_ndatastream.cpp, ex_ndir.cpp, ex_nfileinfo.cpp, ex_ngetopt.cpp, ex_nregex.cpp, ex_nskiplist.cpp, ex_nstring.cpp, ex_nxmlwrite.cpp, ex_skip_vs_sorted.cpp, hashapp.cpp, nsqlapp.cpp, and xmlreader.h.
Definition at line 63 of file nstring.h.
NString | ( | const char * | str | ) |
Constructs a NString object setting it to str.
str | A pointer to a NULL terminated C++ char string |
Definition at line 40 of file nstring.cpp.
Constructs a NString object setting it to str.
str | A NString object with the string |
Definition at line 49 of file nstring.cpp.
NString number | ( | int | num | ) | [static] |
Converts a given number to a NString.
num | A 32 bit integer to be converted |
Definition at line 174 of file nstring.cpp.
References NString().
Referenced by NTcpSocket::connectToHost(), NTcpSocket::execListen(), NXmlError::getLastError(), NHostAddress::setAddress(), NHostAddress::toString(), and NTcpSocket::waitForConnected().
Converts a given number to a NString.
num | A 64 bit integer to be converted |
Definition at line 188 of file nstring.cpp.
References NString().
NString & set | ( | const char * | str | ) |
Sets the string of the current object.
str | A pointer to a NULL terminated C++ char string |
Definition at line 131 of file nstring.cpp.
Referenced by NXmlWriter::dump(), and NDataStream::toString().
Sets the string of the current object.
str | A NString object with the string |
Definition at line 165 of file nstring.cpp.
References toChar().
const char * toChar | ( | void | ) | const |
Converts the string stored by the current object to a char pointer.
Definition at line 169 of file nstring.cpp.
Referenced by NXmlNode::addProperty(), append(), NDataStream::append(), NShaHash::calculate(), NSha1Hash::calculate(), NMd5Hash::calculate(), NMd4Hash::calculate(), NMd2Hash::calculate(), compare(), NTcpSocket::connectToHost(), NMySql::connectToHost(), NMySql::execSql(), NFileInfo::exists(), NFile::exists(), NXmlNode::getProperty(), NFileInfo::groupExecute(), NFileInfo::groupRead(), NFileInfo::groupWrite(), NXmlNode::hasProperty(), NAbstractHash::init(), insert(), NFileInfo::isDevice(), NFileInfo::isDir(), NFileInfo::isFifo(), NFileInfo::isFile(), NFileInfo::isLink(), NRegex::match(), NDir::NDir(), NTime::now(), NRegex::NRegex(), NFile::open(), operator<(), operator<=(), operator>(), operator>=(), NFileInfo::othersExecute(), NFileInfo::othersRead(), NFileInfo::othersWrite(), NFileInfo::ownerExecute(), NFileInfo::ownerRead(), NFileInfo::ownerWrite(), NXmlSchemaParser::parse(), NXmlParser::parse(), NBaseOutput::print(), NBaseOutput::println(), NHostAddress::resolve(), set(), NDataStream::set(), NXmlNode::setData(), NXmlNode::setName(), and NDate::today().
unsigned int length | ( | void | ) | const |
The current lenght of the string.
Definition at line 202 of file nstring.cpp.
Referenced by NShaHash::calculate(), NSha1Hash::calculate(), NMd5Hash::calculate(), NMd4Hash::calculate(), NMd2Hash::calculate(), compare(), find(), insert(), NXmlSchemaParser::parse(), NXmlParser::parse(), replace_first(), and split().
bool isNull | ( | void | ) | const |
Checks whether the current string is null (empty).
Definition at line 207 of file nstring.cpp.
Referenced by compare(), NXmlParser::parse(), and NFile::setFileName().
Appends a string to the current object.
str | A pointer to a NULL terminated string to be appended |
Definition at line 216 of file nstring.cpp.
Referenced by append(), operator+(), and operator+=().
NString & append | ( | const char * | str | ) | [inline] |
Appends a string to the current object.
str | A pointer to a NULL terminated string to be appended |
Definition at line 229 of file nstring.cpp.
References append().
Appends a string to the current object.
str | A NString object to be appended |
Definition at line 235 of file nstring.cpp.
NString & append | ( | char | c | ) |
Appends a char to the current object.
c | An ASCII char |
Definition at line 241 of file nstring.cpp.
References append().
Inserts a string at a given position in the string.
pos | Position where to insert | |
bytes | Number of bytes, from str, to be inserted into the string | |
str | The string to be inserted |
Definition at line 245 of file nstring.cpp.
References length(), and toChar().
Referenced by insert().
Inserts a string at a given position in the string.
pos | Position where to insert | |
str | The string to be inserted |
Definition at line 269 of file nstring.cpp.
Compare the string.
pos | Initial position (start from 0) | |
size | Number of bytes to compare | |
str | The string to be compared |
Definition at line 274 of file nstring.cpp.
References isNull(), length(), and toChar().
Referenced by compare(), find(), operator!=(), and operator==().
Compare the string.
pos | Initial position (start from 0) | |
str | The string to be compared |
Definition at line 301 of file nstring.cpp.
References compare().
Compare the string.
pos | Initial position (start from 0) | |
size | Number of bytes to compare | |
str | The string to be compared | |
str_pos | Initial position on string 'str' |
Definition at line 306 of file nstring.cpp.
Gets a substring.
pos | Initial position (start from 0) | |
size | Number of bytes to get |
Definition at line 322 of file nstring.cpp.
Referenced by replace_first(), and split().
Finds a substring starting from a given position.
str | Substring to find | |
pos | The initial position | |
ocur | The Nth occurrence of the substring to find |
Definition at line 338 of file nstring.cpp.
References NOT_FOUND.
Referenced by NSqlQuery::addBindValue(), NSqlQuery::bindValue(), find(), replace_first(), and split().
Finds a substring starting from a given position.
str | Substring to find | |
pos | The initial position |
Definition at line 351 of file nstring.cpp.
Finds a substring.
str | Substring to find |
Definition at line 365 of file nstring.cpp.
References find().
Replaces the first ocurrence of 'src' with 'dest'.
src | String to find | |
dest | String to replace with |
Definition at line 370 of file nstring.cpp.
References find(), length(), NOT_FOUND, and substr().
Referenced by NSqlQuery::addBindValue(), NSqlQuery::bindValue(), and replace().
Replaces part of the string.
src | String to find | |
dest | String to replace with |
Definition at line 392 of file nstring.cpp.
References replace_first().
Replaces part of the string.
src | String to find | |
dest | String to replace with | |
ocur | The Nth occurrence to replace |
Definition at line 409 of file nstring.cpp.
References replace_first().
Splits the string.
substr | The substring to split at |
Definition at line 431 of file nstring.cpp.
References NList::append(), find(), length(), NOT_FOUND, and substr().
NString operator+ | ( | const char * | str | ) |
Appends a string to the current object.
str | A pointer to a NULL terminated string to be appended |
Definition at line 464 of file nstring.cpp.
References append().
Appends a string to the current object.
str | A NString object to be appended |
Definition at line 474 of file nstring.cpp.
References append().
NString operator+ | ( | char | c | ) |
Appends a char to the current object.
c | An ASCII char |
Definition at line 469 of file nstring.cpp.
References append().
NString & operator+= | ( | const char * | str | ) |
Appends a string to the current object.
str | A pointer to a NULL terminated string to be appended |
Definition at line 479 of file nstring.cpp.
References append().
Appends a string to the current object.
str | A NString object to be appended |
Definition at line 484 of file nstring.cpp.
References append().
NString & operator+= | ( | char | c | ) |
Appends a char to the current object.
c | An ASCII char |
Definition at line 489 of file nstring.cpp.
References append().
char operator[] | ( | unsigned int | index | ) | const |
Access the char at position index.
index | The position of the char in the string |
Definition at line 494 of file nstring.cpp.
bool operator== | ( | const NString & | str | ) | const |
Checks whether the current object is equals str.
str | String to be checked against |
Definition at line 499 of file nstring.cpp.
References compare().
bool operator!= | ( | const NString & | str | ) | const |
Checks whether the current object is not equal to str.
str | String to be checked against |
Definition at line 504 of file nstring.cpp.
References compare().
bool operator> | ( | const NString & | str | ) | const |
Checks whether the current object is lexically greater than str.
str | String to be checked against |
Definition at line 510 of file nstring.cpp.
References toChar().
bool operator< | ( | const NString & | str | ) | const |
Checks whether the current object is lexically less than str.
str | String to be checked against |
Definition at line 522 of file nstring.cpp.
References toChar().
bool operator>= | ( | const NString & | str | ) | const |
Checks whether the current object is lexically greater than or equals str.
str | String to be checked against |
Definition at line 534 of file nstring.cpp.
References toChar().
bool operator<= | ( | const NString & | str | ) | const |
Checks whether the current object is lexically less than or equals str.
str | String to be checked against |
Definition at line 546 of file nstring.cpp.
References toChar().
Sets the string of the current object.
str | A NString object with the string |
Definition at line 558 of file nstring.cpp.
NString & arg | ( | const char * | fmt, | |
... | ||||
) |
Provides formatted output to a NString object.
fmt | Output format |
Definition at line 563 of file nstring.cpp.
Substring not found identified
Definition at line 400 of file nstring.h.
Referenced by NSqlQuery::addBindValue(), NSqlQuery::bindValue(), find(), replace_first(), and split().