nux-0.9.48
|
#include <NuxCore/TextString.h>
Public Member Functions | |
NString () | |
NString (const NString &s) | |
NString (const tstring &s) | |
NString (const TCHAR &s) | |
NString (const ANSICHAR *s) | |
NString (const UNICHAR *s) | |
~NString () | |
NString & | operator= (const NString &s) |
const tstring & | GetTStringRef () const |
const TCHAR * | GetTCharPtr () const |
t_size | Length () const |
t_size | Size () const |
void | Clear () |
bool | IsEmpty () const |
void | Erase (t_size Pos, t_size count) |
NString & | Insert (t_size Pos, const TCHAR *Ptr) |
NString & | Insert (t_size Pos, const TCHAR *Ptr, t_size Count) |
NString & | Insert (t_size Pos, const tstring &Str) |
NString & | Insert (t_size Pos, const tstring &Str, t_size Offset, t_size Count) |
NString & | Insert (t_size Pos, const NString &Str) |
NString & | Insert (t_size Pos, const NString &Str, t_size Offset, t_size Count) |
NString & | Insert (t_size Pos, int Count, const TCHAR &Ch) |
const TCHAR & | operator[] (t_size ChPos) const |
TCHAR & | operator[] (t_size ChPos) |
NString & | Replace (t_size Pos1, t_size Num1, const TCHAR *Ptr) |
NString & | Replace (t_size Pos1, t_size Num1, const TCHAR *Ptr, t_size Num2) |
NString & | Replace (t_size Pos1, t_size Num1, const tstring &Str) |
NString & | Replace (t_size Pos1, t_size Num1, const tstring &Str, t_size Pos2, t_size Num2) |
NString & | Replace (t_size Pos1, t_size Num1, const NString &Str) |
NString & | Replace (t_size Pos1, t_size Num1, const NString &Str, t_size Pos2, t_size Num2) |
NString & | Replace (t_size Pos1, t_size Num1, t_size Count, TCHAR Ch) |
void | Reverse () |
Reverse the string. | |
NString & | SearchAndReplace (TCHAR ChOut, TCHAR ChIn) |
Replace character ChOut with ChIn in the string. | |
t_size | FindLastOccurence (const TCHAR &suffix) const |
Return The last position of the substring suffix or -1 if it is not found. | |
t_size | FindLastOccurence (const TCHAR *suffix) const |
Return The last position of the substring suffix or -1 if it is not found. | |
t_size | FindLastOccurence (const tstring &suffix) const |
Return The last position of the substring suffix or -1 if it is not found. | |
t_size | FindLastOccurence (const NString &suffix) const |
Return The last position of the substring suffix or -1 if it is not found. | |
t_size | FindFirstOccurence (const TCHAR &suffix) const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindFirstOccurence (const TCHAR *suffix) const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindFirstOccurence (const tstring &suffix) const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindFirstOccurence (const NString &suffix) const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindNextOccurence (const TCHAR &suffix, t_size start=0) const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindNextOccurence (const TCHAR *suffix, t_size start=0) const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindNextOccurence (const tstring &suffix, t_size start=0) const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindNextOccurence (const NString &suffix, t_size start=0) const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindFirstOccurenceOf (const TCHAR &str) const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindFirstOccurenceOf (const TCHAR *str) const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindFirstOccurenceOf (const tstring &str) const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindFirstOccurenceOf (const NString &str) const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindLastOccurenceOf (const TCHAR &str) const |
Return the position of the last occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindLastOccurenceOf (const TCHAR *str) const |
Return the position of the last occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindLastOccurenceOf (const tstring &str) const |
Return the position of the last occurrence of the substring suffix or -1 if it is not found. | |
t_size | FindLastOccurenceOf (const NString &str) const |
Return the position of the last occurrence of the substring suffix or -1 if it is not found. | |
t_size | Find (NString str, int start=0) |
Searches this string for the first match of a substring. | |
t_size | Find (TCHAR c, int start=0) |
Searches this string for the first match of a character. | |
bool | IsSuffix (const TCHAR &suffix) |
Return True if the string is terminated by the character 'suffix'. | |
bool | IsSuffix (const TCHAR *suffix) |
Return True if the string is terminated by the character string 'suffix'. | |
bool | IsSuffix (const tstring &suffix) |
Return True if the string is terminated by the tstring 'suffix'. | |
bool | IsSuffix (const NString &suffix) |
Return True if the string is terminated by the NString 'suffix'. | |
bool | IsPrefix (const TCHAR &prefix) |
Return True if the string start with the character contained in prefix. | |
bool | IsPrefix (const TCHAR *prefix) |
Return True if the string start with the character string contained in prefix. | |
bool | IsPrefix (const tstring &prefix) |
Return True if the string start with the tstring contained in prefix. | |
bool | IsPrefix (const NString &prefix) |
Return True if the string start with the NString contained in prefix. | |
void | RemoveSuffix (const TCHAR &suffix) |
Remove the suffix if it is present. | |
void | RemoveSuffix (const TCHAR *suffix) |
Remove the suffix if it is present. | |
void | RemoveSuffix (const tstring &suffix) |
Remove the suffix if it is present. | |
void | RemoveSuffix (const NString &suffix) |
Remove the suffix if it is present. | |
void | RemovePrefix (const TCHAR &prefix) |
Remove the prefix if it is present. | |
void | RemovePrefix (const TCHAR *prefix) |
Remove the prefix if it is present. | |
void | RemovePrefix (const tstring &prefix) |
Remove the prefix if it is present. | |
void | RemovePrefix (const NString &prefix) |
Remove the prefix if it is present. | |
NString | GetSubString (t_size count) const |
Return an NString of the first count characters. | |
NString | GetSubString (t_size start, t_size count) const |
Return an NString of the first count characters starting at position start. | |
NString | Mid (t_size count) const |
Extracts the first N characters.. | |
NString | Mid (t_size start, t_size count) const |
Extracts the middle part of a string. | |
NString | Left (t_size N) const |
Extracts the left part of a string. At most N characters are extracted. | |
NString | Right (t_size N) const |
Extracts the right part of a string. At most N characters are extracted. | |
NString | Trim () const |
Trims all leading and trailing whitespace characters from the string. | |
NString | TrimLeft () const |
Trim the white space characters at the start of this string. Return a trimmed NString. | |
NString | TrimRight () const |
Trim the white space characters at the end of this string. Return a trimmed NString. | |
NString | TrimLeft (NString str) const |
Trim any of the characters in the argument string. Return a trimmed NString. | |
NString | TrimRight (NString str) const |
Trim any of the characters in the argument string. Return a trimmed NString. | |
TCHAR | GetFirstChar () const |
Get first character. | |
TCHAR | GetLastChar () const |
Get last character. | |
const TCHAR * | operator() () const |
const TCHAR * | operator* () const |
NString & | operator+= (const TCHAR &sufix) |
Append a character to this string. | |
NString & | operator+= (const TCHAR *sufix) |
Append a TCHAR* to this string. | |
NString & | operator+= (const tstring sufix) |
Append a tstring to this string. | |
NString & | operator+= (const NString sufix) |
Append an NString to this string. | |
void | SplitAtFirstOccurenceOf (const TCHAR *SplitString, NString &Left, NString &Right) |
void | SplitAtFirstOccurenceOf (const TCHAR &SplitChar, NString &Left, NString &Right) |
void | SplitAtFirstOccurenceOf (const NString &SplitString, NString &Left, NString &Right) |
void | SplitAtLastOccurenceOf (const TCHAR *SplitString, NString &Left, NString &Right) |
void | SplitAtLastOccurenceOf (const TCHAR &SplitChar, NString &Left, NString &Right) |
void | SplitAtLastOccurenceOf (const NString &SplitString, NString &Left, NString &Right) |
void | ParseToArray (std::vector< NString > &StringArray, const NString &delimiter) |
VARARG_DECL (static NString, static NString, return, Printf, VARARG_NONE, const TCHAR *, VARARG_NONE, VARARG_NONE) | |
Data Fields | |
tstring | m_string |
Friends | |
bool | operator!= (const NString &left, const NString &right) |
bool | operator== (const NString &left, const NString &right) |
bool | operator< (const NString &left, const NString &right) |
bool | operator<= (const NString &left, const NString &right) |
bool | operator> (const NString &left, const NString &right) |
bool | operator>= (const NString &left, const NString &right) |
NString | operator+ (const NString &left, const NString &right) |
NString | operator+ (const NString &left, const TCHAR *right) |
NString | operator+ (const NString &left, const TCHAR right) |
NString | operator+ (const TCHAR *left, const NString &right) |
NString | operator+ (const TCHAR left, const NString &right) |
tostream & | operator<< (tostream &o, const NString &s) |
nux::NString::NString | ( | ) |
nux::NString::NString | ( | const NString & | s | ) |
nux::NString::NString | ( | const tstring & | s | ) |
nux::NString::NString | ( | const TCHAR & | s | ) |
nux::NString::NString | ( | const ANSICHAR * | s | ) |
nux::NString::NString | ( | const UNICHAR * | s | ) |
nux::NString::~NString | ( | ) |
void nux::NString::Clear | ( | ) |
Searches this string for the first match of a substring.
Searches this string for the first match of a character.
Return the position of the first occurrence of the substring suffix or -1 if it is not found.
t_size nux::NString::FindFirstOccurence | ( | const tstring & | suffix | ) | const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found.
Return the position of the first occurrence of the substring suffix or -1 if it is not found.
Return the position of the first occurrence of the substring suffix or -1 if it is not found.
Return the position of the first occurrence of the substring suffix or -1 if it is not found.
t_size nux::NString::FindFirstOccurenceOf | ( | const tstring & | str | ) | const |
Return the position of the first occurrence of the substring suffix or -1 if it is not found.
Return the position of the first occurrence of the substring suffix or -1 if it is not found.
Return the position of the first occurrence of the substring suffix or -1 if it is not found.
Return The last position of the substring suffix or -1 if it is not found.
t_size nux::NString::FindLastOccurence | ( | const tstring & | suffix | ) | const |
Return The last position of the substring suffix or -1 if it is not found.
Return The last position of the substring suffix or -1 if it is not found.
Return The last position of the substring suffix or -1 if it is not found.
Return the position of the last occurrence of the substring suffix or -1 if it is not found.
t_size nux::NString::FindLastOccurenceOf | ( | const tstring & | str | ) | const |
Return the position of the last occurrence of the substring suffix or -1 if it is not found.
Return the position of the last occurrence of the substring suffix or -1 if it is not found.
Return the position of the last occurrence of the substring suffix or -1 if it is not found.
Return the position of the first occurrence of the substring suffix or -1 if it is not found.
Return the position of the first occurrence of the substring suffix or -1 if it is not found.
Return the position of the first occurrence of the substring suffix or -1 if it is not found.
Return the position of the first occurrence of the substring suffix or -1 if it is not found.
TCHAR nux::NString::GetFirstChar | ( | ) | const |
Get first character.
TCHAR nux::NString::GetLastChar | ( | ) | const |
Get last character.
Return an NString of the first count characters.
Return an NString of the first count characters starting at position start.
const TCHAR* nux::NString::GetTCharPtr | ( | ) | const |
const tstring& nux::NString::GetTStringRef | ( | ) | const |
bool nux::NString::IsEmpty | ( | ) | const |
bool nux::NString::IsPrefix | ( | const TCHAR & | prefix | ) |
Return True if the string start with the character contained in prefix.
bool nux::NString::IsPrefix | ( | const TCHAR * | prefix | ) |
Return True if the string start with the character string contained in prefix.
bool nux::NString::IsPrefix | ( | const tstring & | prefix | ) |
Return True if the string start with the tstring contained in prefix.
bool nux::NString::IsPrefix | ( | const NString & | prefix | ) |
Return True if the string start with the NString contained in prefix.
bool nux::NString::IsSuffix | ( | const TCHAR & | suffix | ) |
Return True if the string is terminated by the character 'suffix'.
bool nux::NString::IsSuffix | ( | const TCHAR * | suffix | ) |
Return True if the string is terminated by the character string 'suffix'.
bool nux::NString::IsSuffix | ( | const tstring & | suffix | ) |
Return True if the string is terminated by the tstring 'suffix'.
bool nux::NString::IsSuffix | ( | const NString & | suffix | ) |
Return True if the string is terminated by the NString 'suffix'.
Extracts the left part of a string. At most N characters are extracted.
t_size nux::NString::Length | ( | ) | const |
Extracts the middle part of a string.
const TCHAR* nux::NString::operator() | ( | ) | const |
const TCHAR* nux::NString::operator* | ( | ) | const |
NString& nux::NString::operator+= | ( | const tstring | sufix | ) |
Append a tstring to this string.
void nux::NString::RemovePrefix | ( | const TCHAR & | prefix | ) |
Remove the prefix if it is present.
void nux::NString::RemovePrefix | ( | const NString & | prefix | ) |
Remove the prefix if it is present.
void nux::NString::RemovePrefix | ( | const tstring & | prefix | ) |
Remove the prefix if it is present.
void nux::NString::RemovePrefix | ( | const TCHAR * | prefix | ) |
Remove the prefix if it is present.
void nux::NString::RemoveSuffix | ( | const NString & | suffix | ) |
Remove the suffix if it is present.
void nux::NString::RemoveSuffix | ( | const tstring & | suffix | ) |
Remove the suffix if it is present.
void nux::NString::RemoveSuffix | ( | const TCHAR & | suffix | ) |
Remove the suffix if it is present.
void nux::NString::RemoveSuffix | ( | const TCHAR * | suffix | ) |
Remove the suffix if it is present.
NString& nux::NString::Replace | ( | t_size | Pos1, |
t_size | Num1, | ||
const NString & | Str, | ||
t_size | Pos2, | ||
t_size | Num2 | ||
) |
NString& nux::NString::Replace | ( | t_size | Pos1, |
t_size | Num1, | ||
const tstring & | Str, | ||
t_size | Pos2, | ||
t_size | Num2 | ||
) |
void nux::NString::Reverse | ( | ) |
Reverse the string.
Extracts the right part of a string. At most N characters are extracted.
Replace character ChOut with ChIn in the string.
t_size nux::NString::Size | ( | ) | const |
void nux::NString::SplitAtFirstOccurenceOf | ( | const TCHAR & | SplitChar, |
NString & | Left, | ||
NString & | Right | ||
) |
void nux::NString::SplitAtFirstOccurenceOf | ( | const TCHAR * | SplitString, |
NString & | Left, | ||
NString & | Right | ||
) |
void nux::NString::SplitAtFirstOccurenceOf | ( | const NString & | SplitString, |
NString & | Left, | ||
NString & | Right | ||
) |
void nux::NString::SplitAtLastOccurenceOf | ( | const NString & | SplitString, |
NString & | Left, | ||
NString & | Right | ||
) |
void nux::NString::SplitAtLastOccurenceOf | ( | const TCHAR * | SplitString, |
NString & | Left, | ||
NString & | Right | ||
) |
void nux::NString::SplitAtLastOccurenceOf | ( | const TCHAR & | SplitChar, |
NString & | Left, | ||
NString & | Right | ||
) |
NString nux::NString::Trim | ( | ) | const |
Trims all leading and trailing whitespace characters from the string.
NString nux::NString::TrimLeft | ( | ) | const |
Trim the white space characters at the start of this string. Return a trimmed NString.
Trim any of the characters in the argument string. Return a trimmed NString.
NString nux::NString::TrimRight | ( | ) | const |
Trim the white space characters at the end of this string. Return a trimmed NString.
Trim any of the characters in the argument string. Return a trimmed NString.
nux::NString::VARARG_DECL | ( | static | NString, |
static | NString, | ||
return | , | ||
Printf | , | ||
VARARG_NONE | , | ||
const TCHAR * | , | ||
VARARG_NONE | , | ||
VARARG_NONE | |||
) |
Behave like printf. Use an internal buffer of 1024 characters. Do not use this function if you are expecting the result to be more that 1024-1 characters.
tostream& operator<< | ( | tostream & | o, |
const NString & | s | ||
) | [friend] |
tstring nux::NString::m_string |