## Public API Reference

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

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# scfString Class Reference

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

`#include <csutil/scfstr.h>`

Inheritance diagram for scfString:

[legend]
List of all members.

## Public Member Functions

virtual void | Append (char c)
| Append a single character to this string.
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 (const char *iStr, size_t iCount=(size_t)-1)
| Append an ASCIIZ string to this one (up to iCount characters).
virtual void | Clear ()
| Clear the string (so that it contains only ending 0 character).
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 | CompareNoCase (const iString *iStr) const
| Compare two strings ignoring case.
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.
csString & | GetCsString ()
| Get the pointer to the internal csString.
const csString & | GetCsString () const
| Get the pointer to the internal csString.
virtual char * | GetData ()
| Get a pointer to null-terminated character data.
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+= (char c)
| Append a single character to this string.
virtual void | operator+= (const char *iStr)
| Append a null-terminated string to this string.
virtual void | operator+= (const iString &iStr)
| Append another string to this.
virtual bool | operator== (const iString &iStr) const
| Check if two strings are equal.
virtual char | operator[] (size_t iPos) const
| Get the iPos'th character.
virtual char & | operator[] (size_t iPos)
| Get a reference to iPos'th character.
virtual void | Overwrite (size_t iPos, iString const *iStr)
| Overlay another string onto a part of this string.
virtual void | Reclaim ()
| Set string maximal capacity to current string length.
virtual void | Replace (const char *iStr, size_t iCount=(size_t)-1)
| Replace contents of this string with the contents of another.
virtual void | Replace (const iString *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 (const char *copy)
| Yet another copy constructor.
| scfString (const iString &copy)
| Copy constructor.
| scfString (size_t iLength)
| Create an scfString object and reserve space for iLength characters.
| scfString ()
| Create an empty scfString object.
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 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 | ( |  | ) | `[inline]`

| Create an empty scfString object. Definition at line 42 of file scfstr.h.

scfString::scfString | ( | size_t | iLength | ) | `[inline]`

| Create an scfString object and reserve space for iLength characters. Definition at line 47 of file scfstr.h.

scfString::scfString | ( | const iString & | copy | ) | `[inline]`

| Copy constructor. Definition at line 52 of file scfstr.h.

scfString::scfString | ( | const char * | copy | ) | `[inline]`

| Yet another copy constructor. Definition at line 57 of file scfstr.h.

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

| Destroy a scfString object. Definition at line 62 of file scfstr.h.

## Member Function Documentation

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

| Append a single character to this string.

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 | ( | 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::Clear | ( |  | ) | `[inline, virtual]`

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

Deprecated:
  Use Empty() instead.

Implements iString.

Definition at line 100 of file scfstr.h.

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::CompareNoCase | ( | const iString * | iStr | ) | const`[virtual]`

| Compare two strings ignoring case. 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.

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

| Get the pointer to the internal csString. Definition at line 69 of file scfstr.h.

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

| Get the pointer to the internal csString. Definition at line 66 of file scfstr.h. Referenced by csKDTree::Dump(), and csKDTree::StateTest().

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

| Get a pointer to null-terminated character data. Implements iString.

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+= | ( | char | c | ) | `[virtual]`

| Append a single character to this string.

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

| Append a null-terminated string to this string. Implements iString.

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

| Append another string to this. Implements iString.

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

| Check if two strings are equal. Implements iString.

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

| Get the iPos'th character. Implements iString.

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

| Get a reference to 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::Reclaim | ( |  | ) | `[inline, virtual]`

Set string maximal capacity to current string length.

Deprecated:
  Use ShrinkBestFit() instead.

Implements iString.

Definition at line 90 of file scfstr.h.

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::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::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 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