scfString Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
scfString Class Reference

This is a thin SCF wrapper around csString. More...

`#include <csutil/scfstr.h>`

Inheritance diagram for scfString:

List of all members.

## Public Member Functions
virtual void | Append (const char *iStr, size_t iCount=(size_t)-1)
| Append an ASCIIZ string to this one (up to iCount characters)
virtual void | Append (iString const *iStr, size_t iCount=(size_t)-1)
| Append a string to this one (possibly iCount characters from the string)
virtual void | Append (char c)
| Append a single character to this string.
virtual csRef< iString > | Clone () const
| Get a copy of this string.
virtual bool | Compare (const iString *iStr) const
| Check if two strings are equal.
virtual bool | Compare (const char *iStr) const
| Check if two strings are equal.
virtual bool | CompareNoCase (const iString *iStr) const
| Compare two strings ignoring case.
virtual bool | CompareNoCase (const char *iStr) const
| Compare two strings ignoring case.
virtual void | DeleteAt (size_t iPos, size_t iCount)
| Delete iCount characters from position iPos.
virtual void | Downcase ()
| Convert string to lowercase.
virtual void | Empty ()
| Clear the string (so that it contains only ending 0 character).
virtual size_t | Find (const char *search, size_t pos=0) const
| 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
| Find first character 'c' from position 'p'.
virtual size_t | FindLast (const char c, size_t p=(size_t)-1) const
| Find last character 'c', counting backwards from position 'p'.
virtual void | Format (const char *format,...)
| Format.
virtual void | FormatV (const char *format, va_list args)
| Format.
virtual char | GetAt (size_t iPos) const
| Get character at position iPos.
virtual size_t | GetCapacity () const
| Get string capacity.
const csString & | GetCsString () const
| Get the pointer to the internal csString.
csString & | GetCsString ()
| Get the pointer to the internal csString.
virtual char const * | GetData () const
| Get a pointer to null-terminated character data.
virtual size_t | GetGrowsBy () const
| Get the allocation growth increment.
virtual void | Insert (size_t iPos, iString const *iStr)
| Insert another string into this one at position iPos.
virtual bool | IsEmpty () const
| Check if string is empty.
virtual size_t | Length () const
| Query string length.
virtual | operator char const * () const
| Get the null-terminated C string represented by this iString.
virtual bool | operator!= (const iString &iStr) const
| Check if two strings are not equal.
virtual csRef< iString > | operator+ (const iString &iStr) const
| Concatenate two strings and return a third one.
virtual void | operator+= (const iString &iStr)
| Append another string to this.
virtual void | operator+= (const char *iStr)
| Append a null-terminated string to this string.
virtual void | operator+= (char c)
| Append a single character to this string.
virtual bool | operator== (const iString &iStr) const
| Check if two strings are equal.
virtual char & | operator[] (size_t iPos)
| Get a reference to iPos'th character.
virtual char | operator[] (size_t iPos) const
| Get the iPos'th character.
virtual void | Overwrite (size_t iPos, iString const *iStr)
| Overlay another string onto a part of this string.
virtual void | Replace (const iString *iStr, size_t iCount=(size_t)-1)
| Replace contents of this string with the contents of another.
virtual void | Replace (const char *iStr, size_t iCount=(size_t)-1)
| Replace contents of this string with the contents of another.
virtual void | ReplaceAll (const char *search, const char *replacement)
| Find all occurrences of `search` in this string and replace them with `replacement`.
virtual csRef< iString > | ReverseSlice (size_t start, size_t len=(size_t)-1) const
| Copy and return a portion of this string.
virtual void | ReverseSubString (iString *sub, size_t start=0, size_t len=(size_t)-1) const
| Copy a portion of this string.
| scfString ()
| Create an empty scfString object.
| scfString (size_t iLength)
| Create an scfString object and reserve space for iLength characters.
| scfString (const iString &copy)
| Copy constructor.
| scfString (const char *copy)
| Yet another copy constructor.
virtual void | SetAt (size_t iPos, char iChar)
| Set character number iPos to iChar.
virtual void | SetCapacity (size_t NewSize)
| Set string capacity to NewSize characters.
virtual void | SetGrowsBy (size_t)
| Set the allocation growth increment.
virtual void | ShrinkBestFit ()
| Set string maximal capacity to current string length.
virtual csRef< iString > | Slice (size_t start=0, size_t len=(size_t)-1) const
| Copy and return a portion of this string.
virtual bool | StartsWith (const iString *iStr, bool ignore_case=false) const
| Check if this string starts with another.
virtual bool | StartsWith (const char *iStr, bool ignore_case=false) const
| Check if this string starts with another.
virtual void | SubString (iString *sub, size_t start, size_t len=(size_t)-1) const
| Copy a portion of this string.
virtual void | Truncate (size_t iPos)
| Truncate the string.
virtual void | Upcase ()
| Convert string to uppercase.
virtual | ~scfString ()
| Destroy a scfString object.

## Detailed Description

This is a thin SCF wrapper around csString.

Definition at line 34 of file scfstr.h.

## Constructor & Destructor Documentation

scfString::scfString | ( |  | ) |

Create an empty scfString object.

scfString::scfString | ( | size_t | iLength | ) |

Create an scfString object and reserve space for iLength characters.

scfString::scfString | ( | const iString & | copy | ) |

Copy constructor.

scfString::scfString | ( | const char * | copy | ) |

Yet another copy constructor.

virtual scfString::~scfString | ( |  | ) | `[virtual]`

Destroy a scfString object.

## Member Function Documentation

virtual void scfString::Append | ( | const char * | iStr,
|  | size_t | iCount = `(size_t)-1`
| ) |  | `[virtual]`

Append an ASCIIZ string to this one (up to iCount characters)

Implements iString.

virtual void scfString::Append | ( | iString const * | iStr,
|  | size_t | iCount = `(size_t)-1`
| ) |  | `[virtual]`

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

Implements iString.

virtual void scfString::Append | ( | char | c | ) | `[virtual]`

Append a single character to this string.

virtual csRef<iString> scfString::Clone | ( |  | ) | const`[virtual]`

Get a copy of this string.

Implements iString.

virtual bool scfString::Compare | ( | const iString * | iStr | ) | const`[virtual]`

Check if two strings are equal.

Implements iString.

virtual bool scfString::Compare | ( | const char * | iStr | ) | const`[virtual]`

Check if two strings are equal.

virtual bool scfString::CompareNoCase | ( | const iString * | iStr | ) | const`[virtual]`

Compare two strings ignoring case.

Implements iString.

virtual bool scfString::CompareNoCase | ( | const char * | iStr | ) | const`[virtual]`

Compare two strings ignoring case.

virtual void scfString::DeleteAt | ( | size_t | iPos,
|  | size_t | iCount
| ) |  | `[virtual]`

Delete iCount characters from position iPos.

Implements iString.

virtual void scfString::Downcase | ( |  | ) | `[virtual]`

Convert string to lowercase.

Implements iString.

virtual void scfString::Empty | ( |  | ) | `[virtual]`

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

Implements iString.

virtual size_t scfString::Find | ( | const char * | search,
|  | size_t | pos = `0`
| ) |  | const`[virtual]`

Find the first occurrence of `search` in this string starting at `pos`.

Parameters:

  search | String to locate.
  pos | Start position of search (default 0).

Returns:
  First position of `search`, or (size_t)-1 if not found.

Implements iString.

virtual size_t scfString::FindFirst | ( | const char | c,
|  | size_t | p = `(size_t)-1`
| ) |  | const`[virtual]`

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

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

Implements iString.

virtual size_t scfString::FindLast | ( | const char | c,
|  | size_t | p = `(size_t)-1`
| ) |  | const`[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

Implements iString.

virtual void scfString::Format | ( | const char * | format,
|  |  | ...
| ) |  | `[virtual]`

Format.

See also:
  Notes about string formatting in Crystal Space

Implements iString.

virtual void scfString::FormatV | ( | const char * | format,
|  | va_list | args
| ) |  | `[virtual]`

Format.

See also:
  Notes about string formatting in Crystal Space

Implements iString.

virtual char scfString::GetAt | ( | size_t | iPos | ) | const`[virtual]`

Get character at position iPos.

Implements iString.

virtual size_t scfString::GetCapacity | ( |  | ) | const`[virtual]`

Get string capacity.

Implements iString.

const csString& scfString::GetCsString | ( |  | ) | const`[inline]`

Get the pointer to the internal csString.

Definition at line 57 of file scfstr.h.

csString& scfString::GetCsString | ( |  | ) | `[inline]`

Get the pointer to the internal csString.

Definition at line 60 of file scfstr.h.

virtual char const* scfString::GetData | ( |  | ) | const`[virtual]`

Get a pointer to null-terminated character data.

Implements iString.

virtual size_t scfString::GetGrowsBy | ( |  | ) | const`[virtual]`

Get the allocation growth increment.

Implements iString.

virtual void scfString::Insert | ( | size_t | iPos,
|  | iString const * | iStr
| ) |  | `[virtual]`

Insert another string into this one at position iPos.

Implements iString.

virtual bool scfString::IsEmpty | ( |  | ) | const`[virtual]`

Check if string is empty.

Implements iString.

virtual size_t scfString::Length | ( |  | ) | const`[virtual]`

Query string length.

Implements iString.

virtual scfString::operator char const * | ( |  | ) | const`[virtual]`

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

Implements iString.

virtual bool scfString::operator!= | ( | const iString & | iStr | ) | const`[virtual]`

Check if two strings are not equal.

Implements iString.

virtual csRef<iString> scfString::operator+ | ( | const iString & | iStr | ) | const`[virtual]`

Concatenate two strings and return a third one.

Implements iString.

virtual void scfString::operator+= | ( | const iString & | iStr | ) | `[virtual]`

Append another string to this.

Implements iString.

virtual void scfString::operator+= | ( | const char * | iStr | ) | `[virtual]`

Append a null-terminated string to this string.

Implements iString.

virtual void scfString::operator+= | ( | char | c | ) | `[virtual]`

Append a single character to this string.

virtual bool scfString::operator== | ( | const iString & | iStr | ) | const`[virtual]`

Check if two strings are equal.

Implements iString.

virtual char& scfString::operator[] | ( | size_t | iPos | ) | `[virtual]`

Get a reference to iPos'th character.

Implements iString.

virtual char scfString::operator[] | ( | size_t | iPos | ) | const`[virtual]`

Get the iPos'th character.

Implements iString.

virtual void scfString::Overwrite | ( | size_t | iPos,
|  | iString const * | iStr
| ) |  | `[virtual]`

Overlay another string onto a part of this string.

Implements iString.

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

Replace contents of this string with the contents of another.

Implements iString.

virtual void scfString::Replace | ( | const char * | iStr,
|  | size_t | iCount = `(size_t)-1`
| ) |  | `[virtual]`

Replace contents of this string with the contents of another.

Implements iString.

virtual void scfString::ReplaceAll | ( | const char * | search,
|  | const char * | replacement
| ) |  | `[virtual]`

Find all occurrences of `search` in this string and replace them with `replacement`.

Implements iString.

virtual csRef<iString> scfString::ReverseSlice | ( | size_t | start,
|  | size_t | len = `(size_t)-1`
| ) |  | const`[virtual]`

Copy and return a portion of this string.

This version differs from Slice() in that the 'start' parameter is counted from the END of the string rather than the beginning. The substring runs from `start' for `len' characters. If 'len' is omitted, a copy of the string containing all characters after (and including) start is returned.

virtual void scfString::ReverseSubString | ( | iString * | sub,
|  | size_t | start = `0`,
|  | size_t | len = `(size_t)-1`
| ) |  | const`[virtual]`

Copy a portion of this string.

This version differs from SubString() in that the 'start' parameters is counted from the END of the string rather than the beginning. The result is placed in 'sub'. The substring is from 'start', of length 'len'. If 'start' and 'len' are omitted, a copy of the whole string is returned. If 'len' is omitted, a copy of the string containing all characters after (and including) 'start' is returned.

virtual void scfString::SetAt | ( | size_t | iPos,
|  | char | iChar
| ) |  | `[virtual]`

Set character number iPos to iChar.

Implements iString.

virtual void scfString::SetCapacity | ( | size_t | NewSize | ) | `[virtual]`

Set string capacity to NewSize characters.

Implements iString.

virtual void scfString::SetGrowsBy | ( | size_t |  | ) | `[virtual]`

Set the allocation growth increment.

Implements iString.

virtual void scfString::ShrinkBestFit | ( |  | ) | `[virtual]`

Set string maximal capacity to current string length.

Implements iString.

virtual csRef<iString> scfString::Slice | ( | size_t | start = `0`,
|  | size_t | len = `(size_t)-1`
| ) |  | const`[virtual]`

Copy and return a portion of this string.

The substring runs from `start' for `len' characters. If 'start' and 'len' are omitted, a copy of the whole string is returned. If 'len' is omitted, a copy of the string containing all characters after (and including) start is returned.

Implements iString.

virtual bool scfString::StartsWith | ( | const iString * | iStr,
|  | bool | ignore_case = `false`
| ) |  | const`[virtual]`

Check if this string starts with another.

Implements iString.

virtual bool scfString::StartsWith | ( | const char * | iStr,
|  | bool | ignore_case = `false`
| ) |  | const`[virtual]`

Check if this string starts with another.

Implements iString.

virtual void scfString::SubString | ( | iString * | sub,
|  | size_t | start,
|  | size_t | len = `(size_t)-1`
| ) |  | const`[virtual]`

Copy a portion of this string.

The result is placed in 'sub'. The substring is from 'start', of length 'len'. If 'len' is omitted, a copy of the string containing all characters after (and including) 'start' is returned.

Implements iString.

virtual void scfString::Truncate | ( | size_t | iPos | ) | `[virtual]`

Truncate the string.

Implements iString.

virtual void scfString::Upcase | ( |  | ) | `[virtual]`

Convert string to uppercase.

Implements iString.

The documentation for this class was generated from the following file:

- csutil/scfstr.h