ScummVM API documentation
hpl::cString Class Reference

Static Public Member Functions

static tWString To16Char (const tString &asString)
 
static tString To8Char (const tWString &awsString)
 
static tWString Get16BitFromArray (const tString &asArray)
 
static tString Sub (const tString &asString, int alStart, int alCount=-1)
 
static tWString SubW (const tWString &asString, int alStart, int alCount=-1)
 
static tString GetFileExt (const tString &aString)
 
static tWString GetFileExtW (const tWString &aString)
 
static tString SetFileExt (tString aString, tString aExt)
 
static tWString SetFileExtW (tWString aString, tWString aExt)
 
static tString GetFileName (const tString &aString)
 
static tWString GetFileNameW (const tWString &aString)
 
static tString GetFilePath (const tString &aString)
 
static tWString GetFilePathW (const tWString &aString)
 
static tString SetFilePath (const tString &aString, tString aPath)
 
static tWString SetFilePathW (tWString aString, tWString aPath)
 
static tString ToLowerCase (tString aString)
 
static tWString ToLowerCaseW (tWString aString)
 
static tString ReplaceCharTo (tString aString, const tString &asOldChar, const tString &asNewChar)
 
static tWString ReplaceCharToW (tWString aString, const tWString &asOldChar, const tWString &asNewChar)
 
static tString ReplaceStringTo (const tString &aString, const tString &asOldString, const tString &asNewString)
 
static tString ToString (const char *asString, const tString &asDefault)
 
static int ToInt (const char *asString, int alDefault)
 
static bool ToBool (const char *asString, bool abDefault)
 
static float ToFloat (const char *asString, float afDefault)
 
static cColor ToColor (const char *asString, const cColor &aDefault)
 
static cVector2f ToVector2f (const char *asString, const cVector2f &avDefault)
 
static cVector3f ToVector3f (const char *asString, const cVector3f &avDefault)
 
static cVector2l ToVector2l (const char *asString, const cVector2l &avDefault)
 
static cVector3l ToVector3l (const char *asString, const cVector3l &avDefault)
 
static cMatrixf ToMatrixf (const char *asString, const cMatrixf &a_mtxDefault)
 
static tString ToString (int alX)
 
static tString ToString (float afX)
 
static tWString ToStringW (int alX)
 
static tWString ToStringW (float afX)
 
static tIntVecGetIntVec (const tString &asData, tIntVec &avVec, tString *apSeparators=NULL)
 
static tUIntVecGetUIntVec (const tString &asData, tUIntVec &avVec, tString *apSeparators=NULL)
 
static tFloatVecGetFloatVec (const tString &asData, tFloatVec &avVec, tString *apSeparators=NULL)
 
static tStringVecGetStringVec (const tString &asData, tStringVec &avVec, tString *apSeparators=NULL)
 
static tString GetLastChar (const tString &aString)
 
static tWString GetLastCharW (const tWString &aString)
 
static int GetLastStringPos (const tString &aString, const tString &aChar)
 
static int GetLastStringPosW (const tWString &aString, const tWString &aChar)
 
static void UIntStringToArray (unsigned int *apArray, const char *apString, int alSize)
 
static void FloatStringToArray (float *apArray, const char *apString, int alSize)
 

Member Function Documentation

◆ To16Char()

static tWString hpl::cString::To16Char ( const tString asString)
static

Converts ascii to unicode

◆ To8Char()

static tString hpl::cString::To8Char ( const tWString awsString)
static

Converts unicode to ascii

◆ Get16BitFromArray()

static tWString hpl::cString::Get16BitFromArray ( const tString asArray)
static

Gets a 16 bit string from an string of numbers

◆ Sub()

static tString hpl::cString::Sub ( const tString asString,
int  alStart,
int  alCount = -1 
)
static

Get the sub string

Parameters
asStringThe string to get the sub from. The method error check so the params are correct.
alStartThe character to start at.
alCountThe number of character to copy to the sub. -1 = all til end.
Returns

◆ GetFileExt()

static tString hpl::cString::GetFileExt ( const tString aString)
static

Get the file extension of a string

Parameters
aStringextension (for example ".exe"). If none "" is returned.
Returns

◆ SetFileExt()

static tString hpl::cString::SetFileExt ( tString  aString,
tString  aExt 
)
static

Sets the file extension. "" removes extension, for example "test.exe" -> "test"

Parameters
aStringNew string
aExtExtension, both ".exe" and "exe" works
Returns

◆ GetFileName()

static tString hpl::cString::GetFileName ( const tString aString)
static

Gets the file filename in for example: "/files/test/this.txt"

Parameters
aStringThe Filename
Returns

◆ GetFilePath()

static tString hpl::cString::GetFilePath ( const tString aString)
static

Removes the filename from a path

Parameters
aString
Returns

◆ SetFilePath()

static tString hpl::cString::SetFilePath ( const tString aString,
tString  aPath 
)
static

Sets the path for a file.

Parameters
aString
aPathNew path
Returns

◆ ToLowerCase()

static tString hpl::cString::ToLowerCase ( tString  aString)
static

Converts a string to lower case.

Parameters
aString
Returns

◆ ReplaceCharTo()

static tString hpl::cString::ReplaceCharTo ( tString  aString,
const tString asOldChar,
const tString asNewChar 
)
static
Parameters
aStringThe string to do the replacement on
asOldCharThe char to replace (one character only!)
asNewCharThe char to replace with (one character only!)
Returns

◆ ReplaceStringTo()

static tString hpl::cString::ReplaceStringTo ( const tString aString,
const tString asOldString,
const tString asNewString 
)
static
Parameters
aStringThe string to do the replacement on
asOldStringThe char to replace
asNewStringThe char to replace with
Returns

◆ GetIntVec()

static tIntVec& hpl::cString::GetIntVec ( const tString asData,
tIntVec avVec,
tString apSeparators = NULL 
)
static

Get a vector of ints from a string such as "1, 2, 3". Valid separators are ' ', '
', '' and ','

Parameters
&asDataThe string
avVeca vector the values will be appended to.
apSeparatorsa pointer to a string with chars to override the default separators

◆ GetUIntVec()

static tUIntVec& hpl::cString::GetUIntVec ( const tString asData,
tUIntVec avVec,
tString apSeparators = NULL 
)
static

Get a vector of ints from a string such as "1, 2, 3". Valid separators are ' ', '
', '' and ','

Parameters
&asDataThe string
avVeca vector the values will be appended to.
apSeparatorsa pointer to a string with chars to override the default separators

◆ GetFloatVec()

static tFloatVec& hpl::cString::GetFloatVec ( const tString asData,
tFloatVec avVec,
tString apSeparators = NULL 
)
static

Get a vector of floats from a string such as "1, 2, 3". Valid separators are ' ', '
', '' and ','

Parameters
&asDataThe string
avVeca vector the values will be appended to.
apSeparatorsa pointer to a string with chars to override the default separators

◆ GetStringVec()

static tStringVec& hpl::cString::GetStringVec ( const tString asData,
tStringVec avVec,
tString apSeparators = NULL 
)
static

Get a vector of strings from a string such as "one, two, three". Valid separators are ' ', '
', '' and ','

Parameters
&asData
avVec
apSeparatorsa pointer to a string with chars to override the default separators

◆ GetLastChar()

static tString hpl::cString::GetLastChar ( const tString aString)
static

Gets the last character of the string.

Parameters
aString
Returns

◆ GetLastStringPos()

static int hpl::cString::GetLastStringPos ( const tString aString,
const tString aChar 
)
static

Get the last pos where aChar is found.

Parameters
aString
aChar
Returns
>=0 if string is found else -1

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