![]() |
Public API Reference |
![]() |
This is a SCF-compatible interface for csString. More...
#include <iutil/string.h>
Public Member Functions | |
virtual void | Append (const char *Str, size_t Count=(size_t)-1)=0 |
Append a null-terminated C-string to this one. | |
virtual void | Append (const iString *Str, size_t Count=(size_t)-1)=0 |
Append a string to this one. | |
virtual csRef< iString > | Clone () const =0 |
Get a copy of this string. | |
virtual bool | Compare (const iString *Str) const =0 |
Check if another string is equal to this one. | |
virtual bool | CompareNoCase (const iString *Str) const =0 |
Check if another string is equal to this one. | |
virtual void | DeleteAt (size_t Pos, size_t Count=1)=0 |
Delete a range of characters from the string. | |
virtual void | Downcase ()=0 |
Convert string to lowercase. | |
virtual void | Empty ()=0 |
Clear the string (so that it contains only a null terminator). | |
virtual size_t | Find (const char *search, size_t pos=0) const =0 |
Find the first occurrence of search in this string starting at pos . | |
virtual size_t | FindFirst (const char c, size_t p=(size_t)-1) const =0 |
Find the first occurrence of a character in the string. | |
virtual size_t | FindLast (const char c, size_t p=(size_t)-1) const =0 |
Find the last occurrence of a character in the string. | |
virtual void | Format (const char *format,...)=0 |
Format this string using sprintf()-style formatting directives. | |
virtual void | FormatV (const char *format, va_list args)=0 |
Format this string using sprintf() formatting directives in a va_list. | |
virtual char | GetAt (size_t n) const =0 |
Get the n'th character. | |
virtual size_t | GetCapacity () const =0 |
Return the current capacity. | |
virtual char const * | GetData () const =0 |
Get a pointer to the null-terminated character array. | |
virtual size_t | GetGrowsBy () const =0 |
Return the number of bytes by which the string grows. | |
virtual void | Insert (size_t Pos, iString const *Str)=0 |
Insert another string into this one. | |
virtual bool | IsEmpty () const =0 |
Check if string is empty. | |
virtual size_t | Length () const =0 |
Query string length. | |
virtual | operator char const * () const =0 |
Get a pointer to the null-terminated character array. | |
virtual bool | operator!= (const iString &Str) const =0 |
Check if another string is not equal to this one. | |
virtual csRef< iString > | operator+ (const iString &iStr) const =0 |
Concatenate two strings and return a third one. | |
virtual void | operator+= (const iString &iStr)=0 |
Append another string to this one. | |
virtual void | operator+= (const char *iStr)=0 |
Append a null-terminated C-string to this string. | |
virtual bool | operator== (const iString &Str) const =0 |
Check if another string is equal to this one. | |
virtual char & | operator[] (size_t n)=0 |
Get a modifiable reference to n'th character. | |
virtual char | operator[] (size_t n) const =0 |
Get n'th character. | |
virtual void | Overwrite (size_t Pos, iString const *Str)=0 |
Overlay another string onto a part of this string. | |
virtual void | Replace (const iString *str, size_t count=(size_t)-1)=0 |
Replace contents of this string with the contents of another. | |
virtual void | Replace (const char *str, size_t count=(size_t)-1)=0 |
Replace contents of this string with the contents of another. | |
virtual void | ReplaceAll (const char *search, const char *replacement)=0 |
Find all occurrences of search in this string and replace them with replacement . | |
virtual void | SetAt (size_t n, char iChar)=0 |
Set the n'th character. | |
virtual void | SetCapacity (size_t NewSize)=0 |
Advise the string that it should allocate enough space to hold up to NewSize characters. | |
virtual void | SetGrowsBy (size_t)=0 |
Advise the string that it should grow its allocated buffer by approximately this many bytes when more space is required. | |
virtual void | ShrinkBestFit ()=0 |
Set string buffer capacity to hold exactly the current content. | |
virtual csRef< iString > | Slice (size_t start, size_t len) const =0 |
Copy and return a portion of this string. | |
virtual bool | StartsWith (const iString *Str, bool ignore_case=false) const =0 |
Check if this string starts with another one. | |
virtual bool | StartsWith (const char *Str, bool ignore_case=false) const =0 |
Check if this string starts with another null-terminated C-string. | |
virtual void | SubString (iString *sub, size_t start, size_t len) const =0 |
Copy a portion of this string. | |
virtual void | Truncate (size_t Len)=0 |
Truncate the string. | |
virtual void | Upcase ()=0 |
Convert string to uppercase. |
virtual void iString::Append | ( | const char * | Str, |
size_t | Count = (size_t)-1 |
||
) | [pure virtual] |
Append a null-terminated C-string to this one.
Str | String which will be appended. |
Count | Number of characters from Str to append; if -1 (the default), then all characters from Str will be appended. |
Implemented in scfString.
virtual void iString::Append | ( | const iString * | Str, |
size_t | Count = (size_t)-1 |
||
) | [pure virtual] |
Append a string to this one.
Str | String which will be appended. |
Count | Number of characters from Str to append; if -1 (the default), then all characters from Str will be appended. |
Implemented in scfString.
virtual csRef<iString> iString::Clone | ( | ) | const [pure virtual] |
Get a copy of this string.
Implemented in scfString.
virtual bool iString::Compare | ( | const iString * | Str | ) | const [pure virtual] |
Check if another string is equal to this one.
Str | Other string. |
Implemented in scfString.
virtual bool iString::CompareNoCase | ( | const iString * | Str | ) | const [pure virtual] |
Check if another string is equal to this one.
Str | Other string. |
Implemented in scfString.
virtual void iString::DeleteAt | ( | size_t | Pos, |
size_t | Count = 1 |
||
) | [pure virtual] |
Delete a range of characters from the string.
Pos | Beginning of range to be deleted (zero-based). |
Count | Number of characters to delete. |
Implemented in scfString.
virtual void iString::Downcase | ( | ) | [pure virtual] |
Convert string to lowercase.
Implemented in scfString.
virtual void iString::Empty | ( | ) | [pure virtual] |
Clear the string (so that it contains only a null terminator).
Implemented in scfString.
virtual size_t iString::Find | ( | const char * | search, |
size_t | pos = 0 |
||
) | const [pure virtual] |
Find the first occurrence of search
in this string starting at pos
.
search | String to locate. |
pos | Start position of search (default 0). |
search
, or (size_t)-1 if not found. Implemented in scfString.
virtual size_t iString::FindFirst | ( | const char | c, |
size_t | p = (size_t)-1 |
||
) | const [pure virtual] |
Find the first occurrence of a character in the string.
c | Character to locate. |
p | Start position of search (default 0). |
Implemented in scfString.
virtual size_t iString::FindLast | ( | const char | c, |
size_t | p = (size_t)-1 |
||
) | const [pure virtual] |
Find the last occurrence of a character in the string.
c | Character to locate. |
p | Start position of reverse search. Specify (size_t)-1 if you want the search to begin at the very end of string. |
Implemented in scfString.
virtual void iString::Format | ( | const char * | format, |
... | |||
) | [pure virtual] |
Format this string using sprintf()-style formatting directives.
Implemented in scfString.
virtual void iString::FormatV | ( | const char * | format, |
va_list | args | ||
) | [pure virtual] |
Format this string using sprintf() formatting directives in a va_list.
Implemented in scfString.
virtual char iString::GetAt | ( | size_t | n | ) | const [pure virtual] |
Get the n'th character.
Implemented in scfString.
virtual size_t iString::GetCapacity | ( | ) | const [pure virtual] |
Return the current capacity.
Implemented in scfString.
virtual char const* iString::GetData | ( | ) | const [pure virtual] |
Get a pointer to the null-terminated character array.
Implemented in scfString.
virtual size_t iString::GetGrowsBy | ( | ) | const [pure virtual] |
Return the number of bytes by which the string grows.
Implemented in scfString.
virtual void iString::Insert | ( | size_t | Pos, |
iString const * | Str | ||
) | [pure virtual] |
Insert another string into this one.
Pos | Position at which to insert the other string (zero-based). |
Str | String to insert. |
Implemented in scfString.
virtual bool iString::IsEmpty | ( | ) | const [pure virtual] |
virtual size_t iString::Length | ( | ) | const [pure virtual] |
Query string length.
Implemented in scfString.
virtual iString::operator char const * | ( | ) | const [pure virtual] |
Get a pointer to the null-terminated character array.
Implemented in scfString.
virtual bool iString::operator!= | ( | const iString & | Str | ) | const [pure virtual] |
Check if another string is not equal to this one.
Str | Other string. |
Implemented in scfString.
Concatenate two strings and return a third one.
Implemented in scfString.
virtual void iString::operator+= | ( | const iString & | iStr | ) | [pure virtual] |
Append another string to this one.
Implemented in scfString.
virtual void iString::operator+= | ( | const char * | iStr | ) | [pure virtual] |
Append a null-terminated C-string to this string.
Implemented in scfString.
virtual bool iString::operator== | ( | const iString & | Str | ) | const [pure virtual] |
Check if another string is equal to this one.
Str | Other string. |
Implemented in scfString.
virtual char& iString::operator[] | ( | size_t | n | ) | [pure virtual] |
Get a modifiable reference to n'th character.
Implemented in scfString.
virtual char iString::operator[] | ( | size_t | n | ) | const [pure virtual] |
Get n'th character.
Implemented in scfString.
virtual void iString::Overwrite | ( | size_t | Pos, |
iString const * | Str | ||
) | [pure virtual] |
Overlay another string onto a part of this string.
Pos | Position at which to insert the other string (zero-based). |
Str | String which will be overlayed atop this string. |
Implemented in scfString.
virtual void iString::Replace | ( | const iString * | str, |
size_t | count = (size_t)-1 |
||
) | [pure virtual] |
Replace contents of this string with the contents of another.
str | String from which new content of this string will be copied. |
count | Number of characters to copy. If (size_t)-1 is specified, then all characters will be copied. |
Implemented in scfString.
virtual void iString::Replace | ( | const char * | str, |
size_t | count = (size_t)-1 |
||
) | [pure virtual] |
Replace contents of this string with the contents of another.
str | String from which new content of this string will be copied. |
count | Number of characters to copy. If (size_t)-1 is specified, then all characters will be copied. |
Implemented in scfString.
virtual void iString::ReplaceAll | ( | const char * | search, |
const char * | replacement | ||
) | [pure virtual] |
Find all occurrences of search
in this string and replace them with replacement
.
Implemented in scfString.
virtual void iString::SetAt | ( | size_t | n, |
char | iChar | ||
) | [pure virtual] |
Set the n'th character.
Implemented in scfString.
virtual void iString::SetCapacity | ( | size_t | NewSize | ) | [pure virtual] |
Advise the string that it should allocate enough space to hold up to NewSize characters.
Implemented in scfString.
virtual void iString::SetGrowsBy | ( | size_t | ) | [pure virtual] |
Advise the string that it should grow its allocated buffer by approximately this many bytes when more space is required.
This is an optimization to avoid excessive memory reallocation and heap management, which can be quite slow.
Implemented in scfString.
virtual void iString::ShrinkBestFit | ( | ) | [pure virtual] |
Set string buffer capacity to hold exactly the current content.
Implemented in scfString.
virtual csRef<iString> iString::Slice | ( | size_t | start, |
size_t | len | ||
) | const [pure virtual] |
Copy and return a portion of this string.
start | Start position of slice (zero-based). |
len | Number of characters in slice. |
Implemented in scfString.
virtual bool iString::StartsWith | ( | const iString * | Str, |
bool | ignore_case = false |
||
) | const [pure virtual] |
Check if this string starts with another one.
Str | Other string. |
ignore_case | Causes the comparison to be case insensitive if true. |
Implemented in scfString.
virtual bool iString::StartsWith | ( | const char * | Str, |
bool | ignore_case = false |
||
) | const [pure virtual] |
Check if this string starts with another null-terminated C-string.
Str | Other string. |
ignore_case | Causes the comparison to be case insensitive if true. |
Implemented in scfString.
virtual void iString::SubString | ( | iString * | sub, |
size_t | start, | ||
size_t | len | ||
) | const [pure virtual] |
Copy a portion of this string.
sub | String which will receive the indicated substring copy. |
start | Start position of slice (zero-based). |
len | Number of characters in slice. |
Implemented in scfString.
virtual void iString::Truncate | ( | size_t | Len | ) | [pure virtual] |
Truncate the string.
Len | The number of characters to which the string should be truncated (possibly 0). |
Implemented in scfString.
virtual void iString::Upcase | ( | ) | [pure virtual] |
Convert string to uppercase.
Implemented in scfString.