CrystalSpace

Public API Reference

scfString Class Reference

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

#include <csutil/scfstr.h>

Inherits scfImplementation1< scfString, iString >.

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< iStringClone () 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 csStringGetCsString () const
 Get the pointer to the internal csString.
csStringGetCsString ()
 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< iStringoperator+ (const iString &iStr) const
 Concatenate two strings and return a third one.
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 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)
 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 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< iStringReverseSlice (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 (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.
 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< iStringSlice (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).

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).

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.

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

Check if two strings are equal.

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.

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.

virtual void scfString::Downcase (  )  [virtual]

Convert string to lowercase.

virtual void scfString::Empty (  )  [virtual]

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

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

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

virtual void scfString::Format ( const char *  format,
  ... 
) [virtual]
virtual void scfString::FormatV ( const char *  format,
va_list  args 
) [virtual]
virtual char scfString::GetAt ( size_t  iPos  )  const [virtual]

Get character at position iPos.

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

Get string capacity.

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.

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

Get the allocation growth increment.

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

Insert another string into this one at position iPos.

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

Check if string is empty.

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

Query string length.

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

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

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

Check if two strings are not equal.

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

Concatenate two strings and return a third one.

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

Append a null-terminated string to this string.

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

Append a single character to this string.

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

Append another string to this.

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

Check if two strings are equal.

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

Get a reference to iPos'th character.

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

Get the iPos'th character.

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

Overlay another string onto a part of this string.

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

Replace contents of this string with the contents of another.

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

Replace contents of this string with the contents of another.

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

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

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.

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

Set string capacity to NewSize characters.

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

Set the allocation growth increment.

virtual void scfString::ShrinkBestFit (  )  [virtual]

Set string maximal capacity to current string length.

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.

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

Check if this string starts with another.

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

Check if this string starts with another.

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.

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

Truncate the string.

virtual void scfString::Upcase (  )  [virtual]

Convert string to uppercase.


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

Generated for Crystal Space 1.4.1 by doxygen 1.7.1