PixelLightAPI
.
|
Abstract base class that contains the buffer for a string. More...
#include <StringBuffer.h>
Public Member Functions | |
virtual uint32 | GetFormat () const =0 |
Returns the internal string format. | |
virtual StringBufferASCII * | GetASCII ()=0 |
Returns an ASCII string buffer version of the current string. | |
virtual StringBufferUnicode * | GetUnicode ()=0 |
Returns an Unicode string buffer version of the current string. | |
virtual StringBufferUTF8 * | GetUTF8 ()=0 |
Returns an UTF8 string buffer version of the current string. | |
virtual uint32 | GetNumOfBytes () const =0 |
Returns the number of bytes the string buffer is using (excluding the terminating zero, NEVER 0!) | |
virtual StringBuffer * | Clone () const =0 |
Returns a clone of this string buffer. | |
virtual StringBuffer * | Duplicate ()=0 |
Returns a duplicate of this string buffer. | |
virtual bool | IsLessThan (const char szString[], uint32 nLength) const =0 |
Compares this string and the given one lexicographically. | |
virtual bool | IsLessThan (const wchar_t szString[], uint32 nLength) const =0 |
virtual bool | IsGreaterThan (const char szString[], uint32 nLength) const =0 |
Compares this string and the given one lexicographically. | |
virtual bool | IsGreaterThan (const wchar_t szString[], uint32 nLength) const =0 |
virtual bool | Compare (const char szString[], uint32 nLength, uint32 nPos, uint32 nCount) const =0 |
Compare function (case sensitive) | |
virtual bool | Compare (const wchar_t szString[], uint32 nLength, uint32 nPos, uint32 nCount) const =0 |
virtual bool | CompareNoCase (const char szString[], uint32 nLength, uint32 nPos, uint32 nCount) const =0 |
Compare function (case insensitive) | |
virtual bool | CompareNoCase (const wchar_t szString[], uint32 nLength, uint32 nPos, uint32 nCount) const =0 |
virtual bool | IsAlphabetic () const =0 |
Determines whether the string is alphabetic or not. | |
virtual bool | IsAlphaNumeric () const =0 |
Determines whether the string is alpha-numeric or not. | |
virtual bool | IsNumeric () const =0 |
Determines whether the string is numeric. | |
virtual bool | IsSubstring (const char szString[], uint32 nLength) const =0 |
Checks whether the given string is a substring of this string or not. | |
virtual bool | IsSubstring (const wchar_t szString[], uint32 nLength) const =0 |
virtual int | IndexOf (const char szString[], uint32 nPos, uint32 nLength) const =0 |
Returns the index of the substring if contained in this string. | |
virtual int | IndexOf (const wchar_t szString[], uint32 nPos, uint32 nLength) const =0 |
virtual int | LastIndexOf (const char szString[], int nPos, uint32 nLength) const =0 |
Searches from backwards for the index of the substring within this string. | |
virtual int | LastIndexOf (const wchar_t szString[], int nPos, uint32 nLength) const =0 |
virtual StringBuffer * | GetSubstring (uint32 nPos, uint32 nCount) const =0 |
Get a substring from the string. | |
virtual StringBuffer * | ToLower ()=0 |
Change all characters to lower case. | |
virtual StringBuffer * | ToUpper ()=0 |
Change all characters to upper case. | |
virtual StringBuffer * | Delete (uint32 nPos, uint32 nCount)=0 |
Delete a substring. | |
virtual StringBuffer * | Append (const char szString[], uint32 nCount)=0 |
Appends a string at the end of the current string. | |
virtual StringBuffer * | Append (const wchar_t szString[], uint32 nCount)=0 |
virtual StringBuffer * | Insert (const char szString[], uint32 nPos, uint32 nCount)=0 |
Insert a string at a given location. | |
virtual StringBuffer * | Insert (const wchar_t szString[], uint32 nPos, uint32 nCount)=0 |
virtual StringBuffer * | Replace (char nOld, char nNew, uint32 &nReplaced)=0 |
Replaces all occurrences of a character by another character. | |
virtual StringBuffer * | Replace (wchar_t nOld, wchar_t nNew, uint32 &nReplaced)=0 |
virtual StringBuffer * | Replace (const char szOld[], uint32 nOldLength, const char szNew[], uint32 nNewLength, uint32 &nReplaced)=0 |
Replaces all occurrences of a substring by another string. | |
virtual StringBuffer * | Replace (const wchar_t szOld[], uint32 nOldLength, const wchar_t szNew[], uint32 nNewLength, uint32 &nReplaced)=0 |
virtual StringBuffer * | SetCharacter (uint32 nIndex, char nCharacter)=0 |
Sets a character at the given index. | |
virtual StringBuffer * | SetCharacter (uint32 nIndex, wchar_t nCharacter)=0 |
virtual StringBuffer * | TrimLeading ()=0 |
Removes all whitespace (tabs and spaces) at the beginning of the string. | |
virtual StringBuffer * | TrimTrailing ()=0 |
Removes all whitespace (tabs and spaces) at the end of the string. | |
virtual StringBuffer * | RemoveLineEndings ()=0 |
Removes line endings ("\r" or "\n") at the end of the string. | |
Protected Member Functions | |
StringBuffer (uint32 nLength, uint32 nMaxLength, uint8 nType) | |
Constructor. | |
virtual | ~StringBuffer () |
Destructor. | |
PLCORE_API uint32 | GetLength () const |
Returns the length of the string buffer (excluding the terminating zero, NEVER 0!) | |
uint32 | AddReference () |
Increases the reference count. | |
uint32 | Release () |
Decreases the reference count. | |
uint32 | GetRefCount () const |
Gets the current reference count. | |
Protected Attributes | |
uint32 | m_nRefCount |
uint32 | m_nLength |
uint32 | m_nMaxLength |
uint8 | m_nType |
Static Protected Attributes | |
static PLCORE_API StringBufferManager | Manager |
Abstract base class that contains the buffer for a string.
PLCore::StringBuffer::StringBuffer | ( | uint32 | nLength, |
uint32 | nMaxLength, | ||
uint8 | nType | ||
) | [protected] |
[in] | nLength | Length of the string buffer (excluding the terminating zero) |
[in] | nMaxLength | Maximum available length of the string buffer (excluding the terminating zero) |
virtual PLCore::StringBuffer::~StringBuffer | ( | ) | [protected, virtual] |
Destructor.
PLCORE_API uint32 PLCore::StringBuffer::GetLength | ( | ) | const [protected] |
Returns the length of the string buffer (excluding the terminating zero, NEVER 0!)
uint32 PLCore::StringBuffer::AddReference | ( | ) | [protected] |
Increases the reference count.
uint32 PLCore::StringBuffer::Release | ( | ) | [protected] |
Decreases the reference count.
uint32 PLCore::StringBuffer::GetRefCount | ( | ) | const [protected] |
Gets the current reference count.
virtual uint32 PLCore::StringBuffer::GetFormat | ( | ) | const [pure virtual] |
Returns the internal string format.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBufferASCII* PLCore::StringBuffer::GetASCII | ( | ) | [pure virtual] |
Returns an ASCII string buffer version of the current string.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBufferUnicode* PLCore::StringBuffer::GetUnicode | ( | ) | [pure virtual] |
Returns an Unicode string buffer version of the current string.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBufferUTF8* PLCore::StringBuffer::GetUTF8 | ( | ) | [pure virtual] |
Returns an UTF8 string buffer version of the current string.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual uint32 PLCore::StringBuffer::GetNumOfBytes | ( | ) | const [pure virtual] |
Returns the number of bytes the string buffer is using (excluding the terminating zero, NEVER 0!)
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::Clone | ( | ) | const [pure virtual] |
Returns a clone of this string buffer.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::Duplicate | ( | ) | [pure virtual] |
Returns a duplicate of this string buffer.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::IsLessThan | ( | const char | szString[], |
uint32 | nLength | ||
) | const [pure virtual] |
Compares this string and the given one lexicographically.
[in] | szString | String to compare with |
[in] | nLength | Length of the given string (excluding the terminating zero, if another format NEVER 0!) |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::IsLessThan | ( | const wchar_t | szString[], |
uint32 | nLength | ||
) | const [pure virtual] |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::IsGreaterThan | ( | const char | szString[], |
uint32 | nLength | ||
) | const [pure virtual] |
Compares this string and the given one lexicographically.
[in] | szString | String to compare with |
[in] | nLength | Length of the given string (excluding the terminating zero, if another format NEVER 0!) |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::IsGreaterThan | ( | const wchar_t | szString[], |
uint32 | nLength | ||
) | const [pure virtual] |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::Compare | ( | const char | szString[], |
uint32 | nLength, | ||
uint32 | nPos, | ||
uint32 | nCount | ||
) | const [pure virtual] |
Compare function (case sensitive)
[in] | szString | String to compare with |
[in] | nLength | Length of the given string (excluding the terminating zero, NEVER 0!) |
[in] | nPos | Start position within this string (MUST be valid!) |
[in] | nCount | Number of characters to compare, if 0 compare all characters |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::Compare | ( | const wchar_t | szString[], |
uint32 | nLength, | ||
uint32 | nPos, | ||
uint32 | nCount | ||
) | const [pure virtual] |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::CompareNoCase | ( | const char | szString[], |
uint32 | nLength, | ||
uint32 | nPos, | ||
uint32 | nCount | ||
) | const [pure virtual] |
Compare function (case insensitive)
[in] | szString | String to compare with |
[in] | nLength | Length of the given string (excluding the terminating zero, NEVER 0!) |
[in] | nPos | Start position within this string (MUST be valid!) |
[in] | nCount | Number of characters to compare, if 0 compare all characters |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::CompareNoCase | ( | const wchar_t | szString[], |
uint32 | nLength, | ||
uint32 | nPos, | ||
uint32 | nCount | ||
) | const [pure virtual] |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::IsAlphabetic | ( | ) | const [pure virtual] |
Determines whether the string is alphabetic or not.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::IsAlphaNumeric | ( | ) | const [pure virtual] |
Determines whether the string is alpha-numeric or not.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::IsNumeric | ( | ) | const [pure virtual] |
Determines whether the string is numeric.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::IsSubstring | ( | const char | szString[], |
uint32 | nLength | ||
) | const [pure virtual] |
Checks whether the given string is a substring of this string or not.
[in] | szString | String to check |
[in] | nLength | Length of the given string (excluding the terminating zero, if another format NEVER 0!) |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual bool PLCore::StringBuffer::IsSubstring | ( | const wchar_t | szString[], |
uint32 | nLength | ||
) | const [pure virtual] |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual int PLCore::StringBuffer::IndexOf | ( | const char | szString[], |
uint32 | nPos, | ||
uint32 | nLength | ||
) | const [pure virtual] |
Returns the index of the substring if contained in this string.
[in] | szString | String to check |
[in] | nPos | Start position within this string (MUST be valid!) |
[in] | nLength | Length of the given string (excluding the terminating zero, if another format NEVER 0!) |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual int PLCore::StringBuffer::IndexOf | ( | const wchar_t | szString[], |
uint32 | nPos, | ||
uint32 | nLength | ||
) | const [pure virtual] |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual int PLCore::StringBuffer::LastIndexOf | ( | const char | szString[], |
int | nPos, | ||
uint32 | nLength | ||
) | const [pure virtual] |
Searches from backwards for the index of the substring within this string.
[in] | szString | String to check |
[in] | nPos | Start position within this string (MUST be valid!) |
[in] | nLength | Length of the given string (excluding the terminating zero, NEVER 0!) |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual int PLCore::StringBuffer::LastIndexOf | ( | const wchar_t | szString[], |
int | nPos, | ||
uint32 | nLength | ||
) | const [pure virtual] |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::GetSubstring | ( | uint32 | nPos, |
uint32 | nCount | ||
) | const [pure virtual] |
Get a substring from the string.
[in] | nPos | Start position (MUST be valid!) |
[in] | nCount | Number of characters to copy (MUST be valid!) |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::ToLower | ( | ) | [pure virtual] |
Change all characters to lower case.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::ToUpper | ( | ) | [pure virtual] |
Change all characters to upper case.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::Delete | ( | uint32 | nPos, |
uint32 | nCount | ||
) | [pure virtual] |
Delete a substring.
[in] | nPos | Start position of deletion (MUST be valid!) |
[in] | nCount | Number of characters to delete (MUST be valid!) |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::Append | ( | const char | szString[], |
uint32 | nCount | ||
) | [pure virtual] |
Appends a string at the end of the current string.
[in] | szString | String to insert (NEVER empty!) |
[in] | nCount | Number of characters to add (MUST be valid!) |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::Append | ( | const wchar_t | szString[], |
uint32 | nCount | ||
) | [pure virtual] |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::Insert | ( | const char | szString[], |
uint32 | nPos, | ||
uint32 | nCount | ||
) | [pure virtual] |
Insert a string at a given location.
[in] | szString | String to insert (NEVER empty!) |
[in] | nPos | Position at which to insert the string (MUST be valid!) |
[in] | nCount | Number of characters to add (MUST be valid!) |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::Insert | ( | const wchar_t | szString[], |
uint32 | nPos, | ||
uint32 | nCount | ||
) | [pure virtual] |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::Replace | ( | char | nOld, |
char | nNew, | ||
uint32 & | nReplaced | ||
) | [pure virtual] |
Replaces all occurrences of a character by another character.
[in] | nOld | Character to be replaced |
[in] | nNew | Character to replace with (nNew != nOld!!) |
[out] | nReplaced | Receives the number of replaced characters (0 if new = old, MUST be set!) |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::Replace | ( | wchar_t | nOld, |
wchar_t | nNew, | ||
uint32 & | nReplaced | ||
) | [pure virtual] |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::Replace | ( | const char | szOld[], |
uint32 | nOldLength, | ||
const char | szNew[], | ||
uint32 | nNewLength, | ||
uint32 & | nReplaced | ||
) | [pure virtual] |
Replaces all occurrences of a substring by another string.
[in] | szOld | Substring to be replaced (NEVER empty!) |
[in] | nOldLength | Length of the old substring (MUST be valid!) |
[in] | szNew | String to replace with (szNew != szOld, can be empty!) |
[in] | nNewLength | Length of the new substring (MUST be valid but can be 0!) |
[out] | nReplaced | Receives the number of replaced characters (0 if new = old, MUST be set!) |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::Replace | ( | const wchar_t | szOld[], |
uint32 | nOldLength, | ||
const wchar_t | szNew[], | ||
uint32 | nNewLength, | ||
uint32 & | nReplaced | ||
) | [pure virtual] |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::SetCharacter | ( | uint32 | nIndex, |
char | nCharacter | ||
) | [pure virtual] |
Sets a character at the given index.
[in] | nIndex | Character index (MUST be valid!) |
[in] | nCharacter | Character to set at the given index |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::SetCharacter | ( | uint32 | nIndex, |
wchar_t | nCharacter | ||
) | [pure virtual] |
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::TrimLeading | ( | ) | [pure virtual] |
Removes all whitespace (tabs and spaces) at the beginning of the string.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::TrimTrailing | ( | ) | [pure virtual] |
Removes all whitespace (tabs and spaces) at the end of the string.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
virtual StringBuffer* PLCore::StringBuffer::RemoveLineEndings | ( | ) | [pure virtual] |
Removes line endings ("\r" or "\n") at the end of the string.
Implemented in PLCore::StringBufferASCII, PLCore::StringBufferUnicode, and PLCore::StringBufferUTF8.
PLCORE_API StringBufferManager PLCore::StringBuffer::Manager [static, protected] |
String buffer manager
uint32 PLCore::StringBuffer::m_nRefCount [protected] |
Reference count - the "RefCount"-template isn't used because the string buffer manager requires some "special" access to this reference counter
uint32 PLCore::StringBuffer::m_nLength [protected] |
Length of the string (excluding the terminating zero, NEVER 0!)
uint32 PLCore::StringBuffer::m_nMaxLength [protected] |
Maximum available length of the string (excluding the terminating zero, NEVER 0!)
uint8 PLCore::StringBuffer::m_nType [protected] |
String buffer type for variable inspection in debug mode
|