ScummVM API documentation
Titanic::CString Class Reference
Inheritance diagram for Titanic::CString:
Common::String Common::BaseString< char > Titanic::CStringParser

Public Member Functions

 CString (const char *str)
 
 CString (const char *str, uint32 len)
 
 CString (const char *beginP, const char *endP)
 
 CString (const String &str)
 
 CString (char c, uint32 len)
 
 CString (char c)
 
 CString (int val)
 
bool operator== (const CString &x) const
 
bool operator== (const char *x) const
 
bool operator!= (const CString &x) const
 
bool operator!= (const char *x) const
 
CString left (uint count) const
 
CString right (uint count) const
 
CString mid (uint start, uint count) const
 
CString mid (uint start) const
 
CString deleteRight (uint count) const
 
int indexOf (char c) const
 
int indexOf (const char *s) const
 
int lastIndexOf (char c) const
 
bool containsIgnoreCase (const CString &str) const
 
FileType fileTypeSuffix () const
 
ImageType imageTypeSuffix () const
 
int readInt () const
 
- Public Member Functions inherited from Common::String
constexpr String ()
 
 String (const char *str)
 
 String (const char *str, uint32 len)
 
 String (const char *beginP, const char *endP)
 
 String (const String &str)
 
 String (String &&str)
 
constexpr String (value_type c)
 
 String (const U32String &str, CodePage page=kUtf8)
 
Stringoperator= (const char *str)
 
Stringoperator= (const String &str)
 
Stringoperator= (String &&str)
 
Stringoperator= (char c)
 
Stringoperator+= (const char *str)
 
Stringoperator+= (const String &str)
 
Stringoperator+= (char c)
 
bool equalsIgnoreCase (const String &x) const
 
int compareToIgnoreCase (const String &x) const
 
bool equalsIgnoreCase (const char *x) const
 
int compareToIgnoreCase (const char *x) const
 
int compareDictionary (const String &x) const
 
int compareDictionary (const char *x) const
 
bool hasSuffix (const String &x) const
 
bool hasSuffix (const char *x) const
 
bool hasSuffixIgnoreCase (const String &x) const
 
bool hasSuffixIgnoreCase (const char *x) const
 
bool hasPrefix (const String &x) const
 
bool hasPrefix (const char *x) const
 
bool hasPrefixIgnoreCase (const String &x) const
 
bool hasPrefixIgnoreCase (const char *x) const
 
bool contains (const String &x) const
 
bool contains (const char *x) const
 
bool matchString (const char *pat, bool ignoreCase=false, const char *wildcardExclusions=NULL) const
 
bool matchString (const String &pat, bool ignoreCase=false, const char *wildcardExclusions=NULL) const
 
String substr (size_t pos=0, size_t len=npos) const
 
String forEachLine (String(*func)(const String, va_list args),...) const
 
U32String decode (CodePage page=kUtf8) const
 
- Public Member Functions inherited from Common::BaseString< char >
constexpr BaseString ()
 
constexpr BaseString (value_type c)
 
 BaseString (const BaseString &str)
 
 BaseString (BaseString &&str)
 
 BaseString (const value_type *str)
 
 BaseString (const value_type *str, uint32 len)
 
 BaseString (const value_type *beginP, const value_type *endP)
 
bool operator== (const BaseString &x) const
 
bool operator== (const value_type *x) const
 
bool operator!= (const BaseString &x) const
 
bool operator!= (const value_type *x) const
 
bool operator< (const BaseString &x) const
 
bool operator< (const value_type *x) const
 
bool operator<= (const BaseString &x) const
 
bool operator<= (const value_type *x) const
 
bool operator> (const BaseString &x) const
 
bool operator> (const value_type *x) const
 
bool operator>= (const BaseString &x) const
 
bool operator>= (const value_type *x) const
 
bool equals (const BaseString &x) const
 
bool equals (const value_type *x) const
 
bool equalsC (const char *x) const
 
int compareTo (const BaseString &x) const
 
int compareTo (const value_type *x) const
 
int compareToC (const char *x) const
 
void setChar (value_type c, uint32 p)
 
void deleteChar (uint32 p)
 
void deleteLastChar ()
 
void erase (uint32 p, uint32 len=npos)
 
iterator erase (iterator it)
 
void chop (uint32 len=1)
 
void clear ()
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
const value_type * c_str () const
 
uint size () const
 
bool empty () const
 
value_type firstChar () const
 
value_type lastChar () const
 
value_type operator[] (int idx) const
 
bool contains (const BaseString &otherString) const
 
bool contains (value_type x) const
 
void insertChar (value_type c, uint32 p)
 
void insertString (const value_type *s, uint32 p)
 
void insertString (const BaseString &s, uint32 p)
 
uint32 find (value_type x, uint32 pos=0) const
 
size_t find (const value_type *s, uint32 pos=0) const
 
uint32 find (const BaseString &str, uint32 pos=0) const
 
size_t rfind (const value_type *s) const
 
size_t rfind (const BaseString &s) const
 
size_t rfind (value_type c, size_t pos=npos) const
 
size_t findFirstOf (value_type c, size_t pos=0) const
 
size_t findFirstOf (const value_type *chars, size_t pos=0) const
 
size_t findFirstOf (const BaseString &chars, size_t pos=0) const
 
size_t findLastOf (value_type c, size_t pos=npos) const
 
size_t findLastOf (const value_type *chars, size_t pos=npos) const
 
size_t findLastOf (const BaseString &chars, size_t pos=npos) const
 
size_t findFirstNotOf (value_type c, size_t pos=0) const
 
size_t findFirstNotOf (const value_type *chars, size_t pos=0) const
 
size_t findFirstNotOf (const BaseString &chars, size_t pos=0) const
 
size_t findLastNotOf (value_type c) const
 
size_t findLastNotOf (const value_type *chars) const
 
size_t findLastNotOf (const BaseString &chars) const
 
void replace (value_type from, value_type to)
 
void append (const value_type *begin, const value_type *end)
 
void wordWrap (const uint32 maxLength)
 
uint64 asUint64 () const
 
uint64 asUint64Ext () const
 
void toLowercase ()
 
void toUppercase ()
 
void trim ()
 
uint hash () const
 
void replace (uint32 pos, uint32 count, const BaseString &str)
 
void replace (uint32 pos, uint32 count, const value_type *str)
 
void replace (iterator begin, iterator end, const BaseString &str)
 
void replace (iterator begin, iterator end, const value_type *str)
 
void replace (uint32 posOri, uint32 countOri, const BaseString &str, uint32 posDest, uint32 countDest)
 
void replace (uint32 posOri, uint32 countOri, const value_type *str, uint32 posDest, uint32 countDest)
 

Static Public Member Functions

static CString format (const char *fmt,...)
 
- Static Public Member Functions inherited from Common::String
static String format (MSVC_PRINTF const char *fmt,...) GCC_PRINTF(1
 
static String static String vformat (const char *fmt, va_list args)
 
- Static Public Member Functions inherited from Common::BaseString< char >
static void releaseMemoryPoolMutex ()
 

Additional Inherited Members

- Public Types inherited from Common::String
typedef unsigned char unsigned_type
 
- Public Types inherited from Common::BaseString< char >
typedef char value_type
 
typedef char * iterator
 
typedef const char * const_iterator
 
- Public Attributes inherited from Common::BaseString< char >
value_type _storage [_builtinCapacity]
 
int * _refCount
 
uint32 _capacity
 
struct {
   int *   _refCount
 
   uint32   _capacity
 
_extern
 
- Static Public Attributes inherited from Common::BaseString< char >
static const uint32 npos
 
- Protected Member Functions inherited from Common::String
StringEncodingResult encodeUTF8 (const U32String &src, char errorChar)
 
StringEncodingResult encodeWindows932 (const U32String &src, char errorChar)
 
StringEncodingResult encodeWindows936 (const U32String &src, char errorChar)
 
StringEncodingResult encodeWindows949 (const U32String &src, char errorChar)
 
StringEncodingResult encodeWindows950 (const U32String &src, bool translit, char errorChar)
 
StringEncodingResult encodeJohab (const U32String &src, char errorChar)
 
StringEncodingResult encodeOneByte (const U32String &src, CodePage page, bool translit, char errorChar)
 
StringEncodingResult encodeInternal (const U32String &src, CodePage page, char errorChar)
 
StringEncodingResult translitChar (U32String::value_type point, char errorChar)
 
- Protected Member Functions inherited from Common::BaseString< char >
bool isStorageIntern () const
 
void makeUnique ()
 
void ensureCapacity (uint32 new_size, bool keep_old)
 
void incRefCount () const
 
void decRefCount (int *oldRefCount)
 
void initWithValueTypeStr (const value_type *str, uint32 len)
 
void assignInsert (const value_type *str, uint32 p)
 
void assignInsert (value_type c, uint32 p)
 
void assignInsert (const BaseString &str, uint32 p)
 
void assignAppend (const value_type *str)
 
void assignAppend (value_type c)
 
void assignAppend (const BaseString &str)
 
void assign (const BaseString &str)
 
void assign (BaseString &&str)
 
void assign (value_type c)
 
void assign (const value_type *str)
 
bool pointerInOwnBuffer (const value_type *str) const
 
uint getUnsignedValue (uint pos) const
 
void toCase (int(*caseChangeFunc)(int))
 
- Static Protected Member Functions inherited from Common::BaseString< char >
static uint32 cStrLen (const value_type *str)
 
static const value_type * cMemChr (const value_type *ptr, value_type c, size_t count)
 
static value_type * cMemChr (value_type *ptr, value_type c, size_t count)
 
static int cMemCmp (const value_type *ptr1, const value_type *ptr2, size_t count)
 
- Protected Attributes inherited from Common::BaseString< char >
uint32 _size
 
value_type * _str
 
union {
   value_type   _storage [_builtinCapacity]
 
   struct {
      int *   _refCount
 
      uint32   _capacity
 
   }   _extern
 
}; 
 
- Static Protected Attributes inherited from Common::BaseString< char >
static const uint32 _builtinCapacity
 

Member Function Documentation

◆ left()

CString Titanic::CString::left ( uint  count) const

Returns the left n characters of the string

◆ right()

CString Titanic::CString::right ( uint  count) const

Returns the right n characters of the string

◆ mid() [1/2]

CString Titanic::CString::mid ( uint  start,
uint  count 
) const

Returns a substring from within the string

◆ mid() [2/2]

CString Titanic::CString::mid ( uint  start) const

Returns a substring from within the string

◆ deleteRight()

CString Titanic::CString::deleteRight ( uint  count) const

Returns a substring consisting of the entire string except for a specified number of characters at the end

◆ indexOf() [1/2]

int Titanic::CString::indexOf ( char  c) const

Returns the index of the first occurrence of a given character

◆ indexOf() [2/2]

int Titanic::CString::indexOf ( const char *  s) const

Returns the index of the first occurrence of a given string

◆ lastIndexOf()

int Titanic::CString::lastIndexOf ( char  c) const

Returns the index of the last occurrence of a given character

◆ containsIgnoreCase()

bool Titanic::CString::containsIgnoreCase ( const CString str) const

Returns true if the string contains a specified substring, ignoring case

◆ fileTypeSuffix()

FileType Titanic::CString::fileTypeSuffix ( ) const

Returns the type of a filename based on it's extension

◆ imageTypeSuffix()

ImageType Titanic::CString::imageTypeSuffix ( ) const

Returns the type of an image filename based on it's extension

◆ readInt()

int Titanic::CString::readInt ( ) const
inline

Parses the string as an integer and returns the value

◆ format()

static CString Titanic::CString::format ( const char *  fmt,
  ... 
)
static

Format a string


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