CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

iString Struct Reference
[Utilities]

This is a SCF-compatible interface for csString. More...

#include <string.h>

Inheritance diagram for iString:

iBase scfString List of all members.

Public Methods

virtual void SetCapacity (size_t NewSize)=0
 Advise the string that it should allocate enough space to hold up to NewSize characters.

virtual size_t GetCapacity () const=0
 Get string capacity.

virtual void SetGrowsBy (size_t)=0
 Advise the string that it should grow by approximately this many bytes when more space is required.

virtual size_t GetGrowsBy () const=0
 Get the allocation growth increment.

virtual void SetGrowsExponentially (bool)=0
 Tell the string to re-size its buffer exponentially as needed.

virtual bool GetGrowsExponentially () const=0
 Returns true if exponential growth is enabled.

virtual void Truncate (size_t iPos)=0
 Truncate the string.

virtual void Reclaim ()=0
 Set string maximal capacity to current string length.

virtual void Clear ()=0
 Clear the string (so that it contains only ending 0 character).

virtual csRef< iString > Clone () const=0
 Get a copy of this string.

virtual char const * GetData () const=0
 Get a pointer to null-termianted character array.

virtual char * GetData ()=0
 Get a pointer to null-termianted character array.

virtual size_t Length () const=0
 Query string length.

virtual bool IsEmpty () const=0
 Check if string is empty.

virtual char & operator[] (size_t iPos)=0
 Get a reference to iPos'th character.

virtual char operator[] (size_t iPos) const=0
 Get the iPos'th character.

virtual void SetAt (size_t iPos, char iChar)=0
 Set character number iPos to iChar.

virtual char GetAt (size_t iPos) const=0
 Get character at position iPos.

virtual void Insert (size_t iPos, iString const *iStr)=0
 Insert another string into this one at position iPos.

virtual void Overwrite (size_t iPos, iString const *iStr)=0
 Overlay another string onto a part of this string.

virtual void Append (const char *iStr, size_t Count=(size_t)-1)=0
 Append a null-terminated string to this one (up to Count characters).

virtual void Append (const iString *iStr, size_t Count=(size_t)-1)=0
 Append a string to this one (possibly Count characters from the string).

virtual csRef< iString > Slice (size_t start, size_t len) const=0
 Copy and return a portion of this string.

virtual void SubString (iString *sub, size_t start, size_t len) const=0
 Copy a portion of this string.

virtual size_t FindFirst (const char c, size_t p=(size_t)-1) const=0
 Find first character 'c' from position 'p'.

virtual size_t FindLast (const char c, size_t p=(size_t)-1) const=0
 Find last character 'c', counting backwards from position 'p'.

virtual void Format (const char *format,...)=0
 Format this string using sprintf() formatting directives.

virtual void FormatV (const char *format, va_list args)=0
 Format this string using sprintf() formatting directives in a va_list.

virtual void Replace (const iString *iStr, size_t iCount=(size_t)-1)=0
 Replace contents of this string with the contents of another.

virtual bool Compare (const iString *iStr) const=0
 Check if two strings are equal.

virtual bool CompareNoCase (const iString *iStr) const=0
 Compare two strings ignoring case.

virtual void operator+= (const iString &iStr)=0
 Append another string to this.

virtual void operator+= (const char *iStr)=0
 Append an ASCIIZ to this string.

virtual csRef< iString > operator+ (const iString &iStr) const=0
 Concatenate two strings and return a third one.

virtual operator char const * () const=0
 Get the null-terminated C string represented by this iString.

virtual bool operator== (const iString &iStr) const=0
 Check if two strings are equal.

virtual void Downcase ()=0
 Convert string to lowercase.

virtual void Upcase ()=0
 Convert string to uppercase.


Detailed Description

This is a SCF-compatible interface for csString.

Definition at line 35 of file string.h.


Member Function Documentation

virtual void iString::Append const iString *    iStr,
size_t    Count = (size_t)-1
[pure virtual]
 

Append a string to this one (possibly Count characters from the string).

Implemented in scfString.

virtual void iString::Append const char *    iStr,
size_t    Count = (size_t)-1
[pure virtual]
 

Append a null-terminated string to this one (up to Count characters).

Implemented in scfString.

virtual void iString::Clear   [pure virtual]
 

Clear the string (so that it contains only ending 0 character).

Implemented in scfString.

virtual csRef<iString> iString::Clone   [pure virtual]
 

Get a copy of this string.

Implemented in scfString.

virtual bool iString::Compare const iString *    iStr const [pure virtual]
 

Check if two strings are equal.

Implemented in scfString.

virtual bool iString::CompareNoCase const iString *    iStr const [pure virtual]
 

Compare two strings ignoring case.

Implemented in scfString.

virtual void iString::Downcase   [pure virtual]
 

Convert string to lowercase.

Implemented in scfString.

virtual size_t iString::FindFirst const char    c,
size_t    p = (size_t)-1
const [pure virtual]
 

Find first character 'c' from position 'p'.

If the character cannot be found, this function returns (size_t)-1

Implemented in scfString.

virtual size_t iString::FindLast const char    c,
size_t    p = (size_t)-1
const [pure virtual]
 

Find last character 'c', counting backwards from position 'p'.

Default position is the end of the string. If the character cannot be found, this function returns (size_t)-1

Implemented in scfString.

virtual void iString::Format const char *    format,
...   
[pure virtual]
 

Format this string using sprintf() formatting directives.

Automatically allocates sufficient memory to hold result. Newly formatted string overwrites previous string value.

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.

Automatically allocates sufficient memory to hold result. Newly formatted string overwrites previous string value.

Implemented in scfString.

virtual char iString::GetAt size_t    iPos const [pure virtual]
 

Get character at position iPos.

Implemented in scfString.

virtual size_t iString::GetCapacity   [pure virtual]
 

Get string capacity.

Implemented in scfString.

virtual char* iString::GetData   [pure virtual]
 

Get a pointer to null-termianted character array.

Implemented in scfString.

virtual char const* iString::GetData   [pure virtual]
 

Get a pointer to null-termianted character array.

Implemented in scfString.

virtual size_t iString::GetGrowsBy   [pure virtual]
 

Get the allocation growth increment.

Implemented in scfString.

virtual bool iString::GetGrowsExponentially   [pure virtual]
 

Returns true if exponential growth is enabled.

Implemented in scfString.

virtual void iString::Insert size_t    iPos,
iString const *    iStr
[pure virtual]
 

Insert another string into this one at position iPos.

Implemented in scfString.

virtual bool iString::IsEmpty   [pure virtual]
 

Check if string is empty.

Implemented in scfString.

virtual size_t iString::Length   [pure virtual]
 

Query string length.

Implemented in scfString.

virtual iString::operator char const *   [pure virtual]
 

Get the null-terminated C string represented by this iString.

Implemented in scfString.

virtual csRef<iString> iString::operator+ const iString &    iStr const [pure virtual]
 

Concatenate two strings and return a third one.

Implemented in scfString.

virtual void iString::operator+= const char *    iStr [pure virtual]
 

Append an ASCIIZ to this string.

Implemented in scfString.

virtual void iString::operator+= const iString &    iStr [pure virtual]
 

Append another string to this.

Implemented in scfString.

virtual bool iString::operator== const iString &    iStr const [pure virtual]
 

Check if two strings are equal.

Implemented in scfString.

virtual char iString::operator[] size_t    iPos const [pure virtual]
 

Get the iPos'th character.

Implemented in scfString.

virtual char& iString::operator[] size_t    iPos [pure virtual]
 

Get a reference to iPos'th character.

Implemented in scfString.

virtual void iString::Overwrite size_t    iPos,
iString const *    iStr
[pure virtual]
 

Overlay another string onto a part of this string.

Implemented in scfString.

virtual void iString::Reclaim   [pure virtual]
 

Set string maximal capacity to current string length.

Implemented in scfString.

virtual void iString::Replace const iString *    iStr,
size_t    iCount = (size_t)-1
[pure virtual]
 

Replace contents of this string with the contents of another.

Implemented in scfString.

virtual void iString::SetAt size_t    iPos,
char    iChar
[pure virtual]
 

Set character number iPos to iChar.

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.

After calling this method, the string's capacity will be at least NewSize + 1 (one for the implicit null terminator). Never shrinks capacity. If you need to actually reclaim memory, then use Free() or Reclaim().

Implemented in scfString.

virtual void iString::SetGrowsBy size_t    [pure virtual]
 

Advise the string that it should grow by approximately this many bytes when more space is required.

This value is only a suggestion. The actual value by which it grows may be rounded up or down to an implementation-dependent allocation multiple.

Implemented in scfString.

virtual void iString::SetGrowsExponentially bool    [pure virtual]
 

Tell the string to re-size its buffer exponentially as needed.

If set to true, the GetGrowsBy() setting is ignored.

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.

The substring runs from `start' for `len' characters.

Implemented in scfString.

virtual void iString::SubString iString *    sub,
size_t    start,
size_t    len
const [pure virtual]
 

Copy a portion of this string.

The result is placed in 'sub'. The substring is from 'start', of length 'len'.

Implemented in scfString.

virtual void iString::Truncate size_t    iPos [pure virtual]
 

Truncate the string.

Implemented in scfString.

virtual void iString::Upcase   [pure virtual]
 

Convert string to uppercase.

Implemented in scfString.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.18