GPL_String(char *s)
Initialize with a copy of the string s.
GPL_String(const char *s)
Initialize with a copy of the string s.
GPL_String(char *s, const unsigned long l)
Initialize with a copy of l characters from the string s.
GPL_String(const char *s, const unsigned long l)
Initialize with a copy of l characters from the string s.
GPL_String(const unsigned long n, const char c)
Initialize with n copies of the character c.
GPL_String(const GPL_CharPtr & d)
Initialize with the string s.
GPL_String(const GPL_CharPtr & d)
Initialize with the string d.
GPL_String(const GPL_String & s)
Initialize with the string s.
GetData().
operator const char *(void) const
Call GetData().
GPL_String & operator=(char *s)
Copy the characters from the string s.
GPL_String & operator=(const char *s)
Copy the characters from the string s.
GPL_String & operator=(const GPL_String & s)
Perform a shallow copy of the string s.
char & operator[](const unsigned long i)
Return a reference to the i-th character in the string, counting
from zero. This method blindly steps into the data and invalid if the
object is null or the index out-of-bounds. This method makes a private
copy of the data first, since the caller may modify the internal state.
const char & operator[](const unsigned long i) const
Return a reference to the i-th character in the string, counting
from zero. This method blindly steps into the data and invalid if the
object is null or the index out-of-bounds.
inline GPL_Boolean operator==(const GPL_String & s) const
Return TRUE if the string and s are both null or are the same
under lexical comparison. Return FALSE otherwise.
inline GPL_Boolean operator==(char *s) const
Return TRUE if the string and s are both null or are the same
under lexical comparison. Return FALSE otherwise.
inline GPL_Boolean operator==(const char *s) const
Return TRUE if the string and s are both null or are the same
under lexical comparison. Return FALSE otherwise.
inline GPL_Boolean operator!=(const GPL_String & s) const
The logical negation of operator==()sbf().
inline GPL_Boolean operator!=(char *s) const
The logical negation of operator==()sbf().
inline GPL_Boolean operator!=(const char *s) const
The logical negation of operator==()sbf().
inline GPL_Boolean operator<(const GPL_String & s) const
Return TRUE if the string is lexically less than s.
Return FALSE otherwise.
inline GPL_Boolean operator<(char *s) const
Return TRUE if the string is lexically less than s.
Return FALSE otherwise.
inline GPL_Boolean operator<(const char *s) const
Return TRUE if the string is lexically less than s.
Return FALSE otherwise.
inline GPL_Boolean operator<=(const GPL_String & s) const
Return TRUE if the string is lexically less than or equal to s.
Return FALSE otherwise.
inline GPL_Boolean operator<=(char *s) const
Return TRUE if the string is lexically less than or equal to s.
Return FALSE otherwise.
inline GPL_Boolean operator<=(const char *s) const
Return TRUE if the string is lexically less than or equal to s.
Return FALSE otherwise.
inline GPL_Boolean operator>(const GPL_String & s) const
Return TRUE if the string is lexically greater than s.
Return FALSE otherwise.
inline GPL_Boolean operator>(char *s) const
Return TRUE if the string is lexically greater than s.
Return FALSE otherwise.
inline GPL_Boolean operator>(const char *s) const
Return TRUE if the string is lexically greater than s.
Return FALSE otherwise.
inline GPL_Boolean operator>=(const GPL_String & s) const
Return TRUE if the string is lexically greater than or equal to s.
Return FALSE otherwise.
inline GPL_Boolean operator>=(char *s) const
Return TRUE if the string is lexically greater than or equal to s.
Return FALSE otherwise.
inline GPL_Boolean operator>=(const char *s) const
Return TRUE if the string is lexically greater than or equal to s.
Return FALSE otherwise.
inline GPL_Boolean IsNull(void) const
Return TRUE if the string is null. A string may be non-null
and still have no non-null characters. To check for an empty string,
use GetLength().
GPL_CharPtr & GetCharPtr(void)
Return the internal storage object. This method makes a private
copy of the data first, since the caller may modify the internal state.
const GPL_CharPtr & GetCharPtr(void) const
Return the internal storage object.
char *GetData(void)
Return the address of internal storage. This method makes a private
copy of the data first, since the caller may modify the internal state.
char *GetData(void) const
Return the address of internal storage.
unsigned long GetLength(void) const
Return the length of the string or 0 if the string is null.
unsigned long GetSize(void) const
Return the number of characters for which this string has allocated
space.
GPL_String GetSubString(const unsigned long from, const unsigned long to) const
Return a string consisting of all of the characters starting at the
location specified by from and finishing at the location specified
by to or the end of the string, whichever is less.
GPL_String Duplicate(void) const
Return a string which is the exact duplicate of this string.
long Compare(const GPL_String & s) const
Return a value less than, equal to, or greater than zero if this string
is lexically less than, equal to, or greater than s, respectively.
long Compare(char *s) const
Return a value less than, equal to, or greater than zero if this string
is lexically less than, equal to, or greater than s, respectively.
long Compare(const char *s) const
Return a value less than, equal to, or greater than zero if this string
is lexically less than, equal to, or greater than s, respectively.
long Compare(const char *s, const unsigned long l) const
Return a value less than, equal to, or greater than zero if this string
is lexically less than, equal to, or greater than the first l
characters of s, respectively.
long SubCompare(const char *s, const unsigned long l) const
Return a value less than, equal to, or greater than zero if the first
l characters of this string are lexically less than, equal to, or
greater than the first l characters of s, respectively.
long Find(const char c) const
Return the index of the first occurence of c in the string.
Return -1 is c does not occur.
long Find(const GPL_String & s) const
Return the index of the first occurence of s in the string.
Return -1 is s does not occur.
long Find(const char *s) const
Return the index of the first occurence of s in the string.
Return -1 is s does not occur.
long Find(const char *s, const unsigned long l) const
Return the index of the first occurence of the first l characters of
s in the string. Return -1 is the first l characters of
s do not occur.
inline void SetData(char *s)
Specify the characters to use for the string. The contents of s are
copied into the internal buffer up to and including the first null
characters. s may be NULL.
inline void SetData(const char *s)
Specify the characters to use for the string. The contents of s are
copied into the internal buffer up to and including the first null
characters. s may be NULL.
inline void SetData(char *s, const unsigned long l)
Specify the characters to use for the string. The contents of s are
copied into the internal buffer up to the l-th characters. s
may be NULL.
inline void SetData(const char *s, const unsigned long l)
Specify the characters to use for the string. The contents of s are
copied into the internal buffer up to the l-th characters. s
may be NULL.
void Clear(void)
Clear the string without deallocating its storage.
void Resize(const unsigned long l, const char c)
Ensure that the string has storage allocated for l characters,
increasing or decreasing the allocation appropriately. If allocation is
increased, initialize the new space beyond the current strign with the
character c.
void Prepend(const char c)
Prepend the character c to the string.
void Prepend(const GPL_String & string)
Prepend string to the string.
void Prepend(const char *string)
Prepend string to the string.
void Prepend(const char *string, const unsigned long l)
Prepend the first l characters of string to the string.
void Append(const char c)
Append the character c to the string.
void Append(const GPL_String & string)
Append string to the string.
void Append(const char *string)
Append string to the string.
void Append(const char *string, const unsigned long l)
Append the first l characters of string to the string.
void Insert(const unsigned long at, const char c)
Insert the character c into the string at location at.
void Insert(const unsigned long at, const GPL_String & string)
Insert string into the string at location at.
void Insert(const unsigned long at, const char *string)
Insert string into the string at location at.
void Insert(const unsigned long at, const char *string, const unsigned long l)
Insert the first l characters of string into the string at
location at.
void Remove(const unsigned long at, const unsigned long l)
Remove l characters from the string at the location at.
void Printf(char *format, ...)
Print the contents of the string according to the format string
format and the subsequent arguments. See osdVSPrintf().
void VPrintf(char *format, va_list ap)
Print the contents of the string according to the format string
format and the subsequent arguments ap. See osdVSPrintf().
void Scanf(char *format, ...) const
Parse the contents of the string according to the format string
format and the subsequent arguments. See osdVSScanf().
void VScanf(char *format, va_list ap) const
Parse the contents of the string according to the format string
format and the subsequent arguments ap. See osdVSScanf().
void Join(const GPL_String & delimiter, const GPL_String & string)
If this string is empty, assigns string to it. If this string is
not empty, appends delimiter and string to it.
static GPL_String Join(const GPL_String & delimiter, const GPL_Array<GPL_String> & strings)
Return a string consisting of the members of strings joined with
delimieter.
void Split(const GPL_String & delimiter, GPL_String & first, GPL_String & second) const
Split the string at the first occurence of delimiter, placing the
substrings before and after delimiter into first and second,
respectively. If delimiter does not occur in string, first
contains string and second is empty.
static void Split(const GPL_String & string, const GPL_String & delimiter, GPL_String & first, GPL_String & second) const
Split string at the first occurence of delimiter, placing the
substrings before and after delimiter into first and second,
respectively. If delimiter does not occur in string, first
contains string and second is empty.
GPL_String Escape(const GPL_CharPtr & chars) const
Return a copy of the string where every character which is also present
in chars is preceded by '\\'.
static GPL_String Escape(const GPL_String & string, const GPL_CharPtr & chars)
Return a copy of string where every character in string which
is also present in chars is preceded by '\\'.
GPL_String Unescape(const GPL_CharPtr & chars) const
Return a copy of the string where every character which is preceded by
'\\' and is also present in chars is not preceded by
'\\'.
static GPL_String Unescape(const GPL_String & string, const GPL_CharPtr & chars)
Return a copy of string where every character in string which is
preceded by '\\' and is also present in chars is not
preceded by '\\'.
static unsigned long HashFunction(const GPL_String & string)
Return a hash value for string suitable for use in a hash dictionary
(e.g., GPL_Map).
| GPL_STRLEN | Calls strlen() or returns 0 if the string is null. |