orx  1.14
Portable Game Engine
OrxString

Macros

#define orxSTRING_KC_VECTOR_END   ')'
 
#define orxSTRING_KC_VECTOR_END_ALT   '}'
 
#define orxSTRING_KC_VECTOR_SEPARATOR   ','
 
#define orxSTRING_KC_VECTOR_START   '('
 
#define orxSTRING_KC_VECTOR_START_ALT   '{'
 
#define orxString_ToCRC   orxString_Hash
 
#define STRTO_CAST   (int)
 

Functions

static orxINLINE orxS32 orxString_Compare (const orxSTRING _zString1, const orxSTRING _zString2)
 
static orxINLINE orxSTATUS orxString_Delete (orxSTRING _zString)
 
static orxINLINE orxSTRING orxString_Duplicate (const orxSTRING _zSrcString)
 
orxDLLAPI void orxFASTCALL orxString_Exit ()
 
static orxINLINE orxU32 orxString_ExtractBase (const orxSTRING _zString, const orxSTRING *_pzRemaining)
 
static orxINLINE orxU32 orxString_GetCharacterCount (const orxSTRING _zString)
 
static orxINLINE const orxSTRING orxString_GetExtension (const orxSTRING _zFileName)
 
static orxU32 orxFASTCALL orxString_GetFirstCharacterCodePoint (const orxSTRING _zString, const orxSTRING *_pzRemaining)
 
orxDLLAPI const orxSTRING orxFASTCALL orxString_GetFromID (orxSTRINGID _stID)
 
orxDLLAPI orxSTRINGID orxFASTCALL orxString_GetID (const orxSTRING _zString)
 
static orxINLINE orxU32 orxString_GetLength (const orxSTRING _zString)
 
static orxINLINE orxU32 orxString_GetUTF8CharacterLength (orxU32 _u32CharacterCodePoint)
 
orxDLLAPI orxSTRINGID orxFASTCALL orxString_Hash (const orxSTRING _zString)
 
static orxINLINE orxS32 orxString_ICompare (const orxSTRING _zString1, const orxSTRING _zString2)
 
orxDLLAPI orxSTATUS orxFASTCALL orxString_Init ()
 
static orxINLINE orxBOOL orxString_IsCharacterAlphaNumeric (orxU32 _u32CharacterCodePoint)
 
static orxINLINE orxBOOL orxString_IsCharacterASCII (orxU32 _u32CharacterCodePoint)
 
static orxINLINE orxSTRING orxString_LowerCase (orxSTRING _zString)
 
static orxINLINE orxS32 orxString_NCompare (const orxSTRING _zString1, const orxSTRING _zString2, orxU32 _u32CharNumber)
 
static orxINLINE orxSTRING orxString_NCopy (orxSTRING _zDstString, const orxSTRING _zSrcString, orxU32 _u32CharNumber)
 
orxDLLAPI orxSTRINGID orxFASTCALL orxString_NHash (const orxSTRING _zString, orxU32 _u32CharNumber)
 
static orxINLINE orxS32 orxString_NICompare (const orxSTRING _zString1, const orxSTRING _zString2, orxU32 _u32CharNumber)
 
static orxINLINE orxS32 orxCDECL orxString_NPrint (orxSTRING _zDstString, orxU32 _u32CharNumber, const orxSTRING _zSrcString,...)
 
static orxU32 orxFASTCALL orxString_PrintUTF8Character (orxSTRING _zDstString, orxU32 _u32Size, orxU32 _u32CharacterCodePoint)
 
static orxINLINE orxS32 orxCDECL orxString_Scan (const orxSTRING _zString, const orxSTRING _zFormat,...)
 
static orxINLINE const orxSTRING orxString_SearchChar (const orxSTRING _zString, orxCHAR _cChar)
 
static orxINLINE orxS32 orxString_SearchCharIndex (const orxSTRING _zString, orxCHAR _cChar, orxS32 _s32Position)
 
static orxINLINE const orxSTRING orxString_SearchString (const orxSTRING _zString1, const orxSTRING _zString2)
 
orxDLLAPI void orxFASTCALL orxString_Setup ()
 
static orxINLINE const orxSTRING orxString_SkipPath (const orxSTRING _zString)
 
static orxINLINE const orxSTRING orxString_SkipWhiteSpaces (const orxSTRING _zString)
 
orxDLLAPI const orxSTRING orxFASTCALL orxString_Store (const orxSTRING _zString)
 
static orxINLINE orxSTATUS orxString_ToBool (const orxSTRING _zString, orxBOOL *_pbOutValue, const orxSTRING *_pzRemaining)
 
static orxINLINE orxSTATUS orxString_ToFloat (const orxSTRING _zString, orxFLOAT *_pfOutValue, const orxSTRING *_pzRemaining)
 
static orxINLINE orxSTATUS orxString_ToS32 (const orxSTRING _zString, orxS32 *_ps32OutValue, const orxSTRING *_pzRemaining)
 
static orxINLINE orxSTATUS orxString_ToS32Base (const orxSTRING _zString, orxU32 _u32Base, orxS32 *_ps32OutValue, const orxSTRING *_pzRemaining)
 
static orxINLINE orxSTATUS orxString_ToS64 (const orxSTRING _zString, orxS64 *_ps64OutValue, const orxSTRING *_pzRemaining)
 
static orxINLINE orxSTATUS orxString_ToS64Base (const orxSTRING _zString, orxU32 _u32Base, orxS64 *_ps64OutValue, const orxSTRING *_pzRemaining)
 
static orxINLINE orxSTATUS orxString_ToU32 (const orxSTRING _zString, orxU32 *_pu32OutValue, const orxSTRING *_pzRemaining)
 
static orxINLINE orxSTATUS orxString_ToU32Base (const orxSTRING _zString, orxU32 _u32Base, orxU32 *_pu32OutValue, const orxSTRING *_pzRemaining)
 
static orxINLINE orxSTATUS orxString_ToU64 (const orxSTRING _zString, orxU64 *_pu64OutValue, const orxSTRING *_pzRemaining)
 
static orxINLINE orxSTATUS orxString_ToU64Base (const orxSTRING _zString, orxU32 _u32Base, orxU64 *_pu64OutValue, const orxSTRING *_pzRemaining)
 
static orxINLINE orxSTATUS orxString_ToVector (const orxSTRING _zString, orxVECTOR *_pvOutValue, const orxSTRING *_pzRemaining)
 
static orxINLINE orxSTRING orxString_UpperCase (orxSTRING _zString)
 

Detailed Description

String module Module that handles strings

Macro Definition Documentation

#define orxSTRING_KC_VECTOR_END   ')'

Definition at line 79 of file orxString.h.

#define orxSTRING_KC_VECTOR_END_ALT   '}'

Definition at line 80 of file orxString.h.

#define orxSTRING_KC_VECTOR_SEPARATOR   ','

Definition at line 78 of file orxString.h.

#define orxSTRING_KC_VECTOR_START   '('

Definition at line 76 of file orxString.h.

#define orxSTRING_KC_VECTOR_START_ALT   '{'

Definition at line 77 of file orxString.h.

#define orxString_ToCRC   orxString_Hash

Defines

Definition at line 86 of file orxString.h.

#define STRTO_CAST   (int)

Definition at line 62 of file orxString.h.

Function Documentation

static orxINLINE orxS32 orxString_Compare ( const orxSTRING  _zString1,
const orxSTRING  _zString2 
)
static

Compare two strings, case sensitive. If the first one is smaller than the second it returns -1, 1 if the second one is bigger than the first, and 0 if they are equals

Parameters
[in]_zString1First String to compare
[in]_zString2Second string to compare
Returns
-1, 0 or 1 as indicated in the description.

Definition at line 602 of file orxString.h.

static orxINLINE orxSTATUS orxString_Delete ( orxSTRING  _zString)
static

Deletes a string

Parameters
[in]_zStringString to delete

Definition at line 583 of file orxString.h.

static orxINLINE orxSTRING orxString_Duplicate ( const orxSTRING  _zSrcString)
static

Duplicate a string.

Parameters
[in]_zSrcStringString to duplicate.
Returns
Duplicated string.

Definition at line 555 of file orxString.h.

orxDLLAPI void orxFASTCALL orxString_Exit ( )

Exits from the structure module

static orxINLINE orxU32 orxString_ExtractBase ( const orxSTRING  _zString,
const orxSTRING *  _pzRemaining 
)
static

Extracts the base (2, 8, 10 or 16) from a literal number

Parameters
[in]_zStringString from which to extract the base
[out]_pzRemainingIf non null, will contain the remaining literal number, right after the base prefix (0x, 0b or 0)
Returns
Base or the numerical value, defaults to 10 (decimal) when no prefix is found or the literal value couldn't be identified

Definition at line 687 of file orxString.h.

static orxINLINE orxU32 orxString_GetCharacterCount ( const orxSTRING  _zString)
static

Returns the number of valid unicode characters (UTF-8) in the string (for ASCII string, it will be the same result as orxString_GetLength())

Parameters
[in]_zStringConcerned string
Returns
Number of valid unicode characters contained in the string, orxU32_UNDEFINED for an invalid UTF-8 string

Definition at line 506 of file orxString.h.

static orxINLINE const orxSTRING orxString_GetExtension ( const orxSTRING  _zFileName)
static

Gets the extension from a file name

Parameters
[in]_zFileNameConcerned file name
Returns
Extension if exists, orxSTRING_EMPTY otherwise

Definition at line 1451 of file orxString.h.

static orxU32 orxFASTCALL orxString_GetFirstCharacterCodePoint ( const orxSTRING  _zString,
const orxSTRING *  _pzRemaining 
)
static

Returns the code of the first character of the UTF-8 string

Parameters
[in]_zStringConcerned string
[out]_pzRemainingIf non null, will contain the remaining string after the first UTF-8 character
Returns
Code of the first UTF-8 character of the string, orxU32_UNDEFINED if it's an invalid character

Definition at line 339 of file orxString.h.

orxDLLAPI const orxSTRING orxFASTCALL orxString_GetFromID ( orxSTRINGID  _stID)

Gets a string from an ID (it should have already been stored internally with a call to orxString_GetID)

Parameters
[in]_stIDConcerned string ID
Returns
orxSTRING if ID's found, orxSTRING_EMPTY otherwise
orxDLLAPI orxSTRINGID orxFASTCALL orxString_GetID ( const orxSTRING  _zString)

Gets a string's ID (and stores the string internally to prevent duplication)

Parameters
[in]_zStringConcerned string
Returns
String's ID
static orxINLINE orxU32 orxString_GetLength ( const orxSTRING  _zString)
static

Returns the number of orxCHAR in the string (for non-ASCII UTF-8 string, it won't be the actual number of unicode characters)

Parameters
[in]_zStringString used for length computation
Returns
Length of the string (doesn't count final orxCHAR_NULL)

Definition at line 170 of file orxString.h.

static orxINLINE orxU32 orxString_GetUTF8CharacterLength ( orxU32  _u32CharacterCodePoint)
static

Gets the UTF-8 encoding length of given character

Parameters
[in]_u32CharacterCodePointConcerned character code
Returns
Encoding length in UTF-8 for given character if valid, orxU32_UNDEFINED otherwise

Definition at line 205 of file orxString.h.

orxDLLAPI orxSTRINGID orxFASTCALL orxString_Hash ( const orxSTRING  _zString)

Gets a string's ID (aka hash), without storing the string internally

Parameters
[in]_zStringConcerned string
Returns
String's ID/hash
static orxINLINE orxS32 orxString_ICompare ( const orxSTRING  _zString1,
const orxSTRING  _zString2 
)
static

Compare two strings, case insensitive. If the first one is smaller than the second, it returns -1, If the second one is bigger than the first, and 0 if they are equals

Parameters
[in]_zString1First String to compare
[in]_zString2Second string to compare
Returns
-1, 0 or 1 as indicated in the description.

Definition at line 636 of file orxString.h.

orxDLLAPI orxSTATUS orxFASTCALL orxString_Init ( )

Initializess the structure module

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
static orxINLINE orxBOOL orxString_IsCharacterAlphaNumeric ( orxU32  _u32CharacterCodePoint)
static

Tells if a character is alpha-numeric from its ID

Parameters
[in]_u32CharacterCodePointConcerned character code
Returns
orxTRUE is it's a non-extended ASCII alpha-numerical character, orxFALSE otherwise

Definition at line 193 of file orxString.h.

static orxINLINE orxBOOL orxString_IsCharacterASCII ( orxU32  _u32CharacterCodePoint)
static

Tells if a character is ASCII from its ID

Parameters
[in]_u32CharacterCodePointConcerned character code
Returns
orxTRUE is it's a non-extended ASCII character, orxFALSE otherwise

Definition at line 183 of file orxString.h.

static orxINLINE orxSTRING orxString_LowerCase ( orxSTRING  _zString)
static

Lowercase a string

Parameters
[in]_zStringString To convert
Returns
The converted string.

Definition at line 1275 of file orxString.h.

static orxINLINE orxS32 orxString_NCompare ( const orxSTRING  _zString1,
const orxSTRING  _zString2,
orxU32  _u32CharNumber 
)
static

Compare N first character from two strings, case sensitive. If the first one is smaller than the second it returns -1, 1 if the second one is bigger than the first and 0 if they are equals.

Parameters
[in]_zString1First String to compare
[in]_zString2Second string to compare
[in]_u32CharNumberNumber of character to compare
Returns
-1, 0 or 1 as indicated in the description.

Definition at line 620 of file orxString.h.

static orxINLINE orxSTRING orxString_NCopy ( orxSTRING  _zDstString,
const orxSTRING  _zSrcString,
orxU32  _u32CharNumber 
)
static

Copies up to N characters from a string

Parameters
[in]_zDstStringDestination string
[in]_zSrcStringSource string
[in]_u32CharNumberNumber of characters to copy
Returns
Copied string

Definition at line 540 of file orxString.h.

orxDLLAPI orxSTRINGID orxFASTCALL orxString_NHash ( const orxSTRING  _zString,
orxU32  _u32CharNumber 
)

Gets a string's ID (aka hash), without storing the string internally

Parameters
[in]_zStringConcerned string
[in]_u32CharNumberNumber of character to process, should be <= orxString_GetLength(_zString)
Returns
String's ID/hash
static orxINLINE orxS32 orxString_NICompare ( const orxSTRING  _zString1,
const orxSTRING  _zString2,
orxU32  _u32CharNumber 
)
static

Compare N first character from two strings, case insensitive. If the first one is smaller than the second, it returns -1, If the second one is bigger than the first, and 0 if they are equals.

Parameters
[in]_zString1First String to compare
[in]_zString2Second string to compare
[in]_u32CharNumberNumber of character to compare
Returns
-1, 0 or 1 as indicated in the description.

Definition at line 663 of file orxString.h.

static orxINLINE orxS32 orxCDECL orxString_NPrint ( orxSTRING  _zDstString,
orxU32  _u32CharNumber,
const orxSTRING  _zSrcString,
  ... 
)
static

Prints a formatted string to a memory buffer using a max size

Parameters
[out]_zDstStringDestination string
[in]_u32CharNumberMax number of character to print, including the terminating null character
[in]_zSrcStringSource formatted string
Returns
The number of written characters, excluding the terminating null character

Definition at line 1388 of file orxString.h.

static orxU32 orxFASTCALL orxString_PrintUTF8Character ( orxSTRING  _zDstString,
orxU32  _u32Size,
orxU32  _u32CharacterCodePoint 
)
static

Prints a unicode character encoded with UTF-8 to an orxSTRING

Parameters
[in]_zDstStringDestination string
[in]_u32SizeAvailable size on the string
[in]_u32CharacterCodePointUnicode code point of the character to print
Returns
Length of the encoded UTF-8 character (1, 2, 3 or 4) if valid, orxU32_UNDEFINED otherwise

Definition at line 246 of file orxString.h.

static orxINLINE orxS32 orxCDECL orxString_Scan ( const orxSTRING  _zString,
const orxSTRING  _zFormat,
  ... 
)
static

Scans a formatted string from a memory buffer

Parameters
[in]_zStringString to scan
[in]_zFormatFormat string
Returns
The number of scanned items

Definition at line 1427 of file orxString.h.

static orxINLINE const orxSTRING orxString_SearchChar ( const orxSTRING  _zString,
orxCHAR  _cChar 
)
static

Returns the first occurrence of _cChar in _zString

Parameters
[in]_zStringString to analyze
[in]_cCharThe character to find
Returns
The pointer of the first occurrence of _cChar, or orxNULL if not found

Definition at line 1341 of file orxString.h.

static orxINLINE orxS32 orxString_SearchCharIndex ( const orxSTRING  _zString,
orxCHAR  _cChar,
orxS32  _s32Position 
)
static

Returns the first occurrence of _cChar in _zString

Parameters
[in]_zStringString to analyze
[in]_cCharThe character to find
[in]_s32PositionSearch begin position
Returns
The index of the next occurrence of requested character, starting at given position / -1 if not found

Definition at line 1356 of file orxString.h.

static orxINLINE const orxSTRING orxString_SearchString ( const orxSTRING  _zString1,
const orxSTRING  _zString2 
)
static

Returns the first occurrence of _zString2 in _zString1

Parameters
[in]_zString1String to analyze
[in]_zString2String that must be inside _zString1
Returns
The pointer of the first occurrence of _zString2, or orxNULL if not found

Definition at line 1326 of file orxString.h.

orxDLLAPI void orxFASTCALL orxString_Setup ( )

Structure module setup

static orxINLINE const orxSTRING orxString_SkipPath ( const orxSTRING  _zString)
static

Skips path

Parameters
[in]_zStringConcerned string
Returns
Sub string located after all non-terminal directory separators

Definition at line 127 of file orxString.h.

static orxINLINE const orxSTRING orxString_SkipWhiteSpaces ( const orxSTRING  _zString)
static

Skips all white spaces

Parameters
[in]_zStringConcerned string
Returns
Sub string located after all leading white spaces, including EOL characters

Definition at line 96 of file orxString.h.

orxDLLAPI const orxSTRING orxFASTCALL orxString_Store ( const orxSTRING  _zString)

Stores a string internally: equivalent to an optimized call to orxString_GetFromID(orxString_GetID(_zString))

Parameters
[in]_zStringConcerned string
Returns
Stored orxSTRING
static orxINLINE orxSTATUS orxString_ToBool ( const orxSTRING  _zString,
orxBOOL *  _pbOutValue,
const orxSTRING *  _pzRemaining 
)
static

Convert a string to a boolean

Parameters
[in]_zStringString To convert
[out]_pbOutValueConverted value
[out]_pzRemainingIf non null, will contain the remaining string after the boolean conversion
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Definition at line 1202 of file orxString.h.

static orxINLINE orxSTATUS orxString_ToFloat ( const orxSTRING  _zString,
orxFLOAT *  _pfOutValue,
const orxSTRING *  _pzRemaining 
)
static

Convert a string to a value

Parameters
[in]_zStringString To convert
[out]_pfOutValueConverted value
[out]_pzRemainingIf non null, will contain the remaining string after the number conversion
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Definition at line 1050 of file orxString.h.

static orxINLINE orxSTATUS orxString_ToS32 ( const orxSTRING  _zString,
orxS32 *  _ps32OutValue,
const orxSTRING *  _pzRemaining 
)
static

Converts a String to a signed int value, guessing the base

Parameters
[in]_zStringString To convert
[out]_ps32OutValueConverted value
[out]_pzRemainingIf non null, will contain the remaining string after the number conversion
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Definition at line 820 of file orxString.h.

static orxINLINE orxSTATUS orxString_ToS32Base ( const orxSTRING  _zString,
orxU32  _u32Base,
orxS32 *  _ps32OutValue,
const orxSTRING *  _pzRemaining 
)
static

Converts a String to a signed int value using the given base

Parameters
[in]_zStringString To convert
[in]_u32BaseBase of the read value (generally 10, but can be 16 to read hexa)
[out]_ps32OutValueConverted value
[out]_pzRemainingIf non null, will contain the remaining string after the number conversion
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Definition at line 779 of file orxString.h.

static orxINLINE orxSTATUS orxString_ToS64 ( const orxSTRING  _zString,
orxS64 *  _ps64OutValue,
const orxSTRING *  _pzRemaining 
)
static

Converts a String to a signed int value, guessing the base

Parameters
[in]_zStringString To convert
[out]_ps64OutValueConverted value
[out]_pzRemainingIf non null, will contain the remaining string after the number conversion
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Definition at line 956 of file orxString.h.

static orxINLINE orxSTATUS orxString_ToS64Base ( const orxSTRING  _zString,
orxU32  _u32Base,
orxS64 *  _ps64OutValue,
const orxSTRING *  _pzRemaining 
)
static

Converts a String to a signed int value using the given base

Parameters
[in]_zStringString To convert
[in]_u32BaseBase of the read value (generally 10, but can be 16 to read hexa)
[out]_ps64OutValueConverted value
[out]_pzRemainingIf non null, will contain the remaining string after the number conversion
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Definition at line 915 of file orxString.h.

static orxINLINE orxSTATUS orxString_ToU32 ( const orxSTRING  _zString,
orxU32 *  _pu32OutValue,
const orxSTRING *  _pzRemaining 
)
static

Converts a String to an unsigned int value, guessing the base

Parameters
[in]_zStringString To convert
[out]_pu32OutValueConverted value
[out]_pzRemainingIf non null, will contain the remaining string after the number conversion
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Definition at line 888 of file orxString.h.

static orxINLINE orxSTATUS orxString_ToU32Base ( const orxSTRING  _zString,
orxU32  _u32Base,
orxU32 *  _pu32OutValue,
const orxSTRING *  _pzRemaining 
)
static

Converts a String to an unsigned int value using the given base

Parameters
[in]_zStringString To convert
[in]_u32BaseBase of the read value (generally 10, but can be 16 to read hexa)
[out]_pu32OutValueConverted value
[out]_pzRemainingIf non null, will contain the remaining string after the number conversion
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Definition at line 847 of file orxString.h.

static orxINLINE orxSTATUS orxString_ToU64 ( const orxSTRING  _zString,
orxU64 *  _pu64OutValue,
const orxSTRING *  _pzRemaining 
)
static

Converts a String to an unsigned int value, guessing the base

Parameters
[in]_zStringString To convert
[out]_pu64OutValueConverted value
[out]_pzRemainingIf non null, will contain the remaining string after the number conversion
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Definition at line 1024 of file orxString.h.

static orxINLINE orxSTATUS orxString_ToU64Base ( const orxSTRING  _zString,
orxU32  _u32Base,
orxU64 *  _pu64OutValue,
const orxSTRING *  _pzRemaining 
)
static

Converts a String to an unsigned int value using the given base

Parameters
[in]_zStringString To convert
[in]_u32BaseBase of the read value (generally 10, but can be 16 to read hexa)
[out]_pu64OutValueConverted value
[out]_pzRemainingIf non null, will contain the remaining string after the number conversion
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Definition at line 983 of file orxString.h.

static orxINLINE orxSTATUS orxString_ToVector ( const orxSTRING  _zString,
orxVECTOR _pvOutValue,
const orxSTRING *  _pzRemaining 
)
static

Convert a string to a vector

Parameters
[in]_zStringString To convert
[out]_pvOutValueConverted value. N.B.: if only two components (x, y) are defined, the z component will be set to zero
[out]_pzRemainingIf non null, will contain the remaining string after the number conversion
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Definition at line 1101 of file orxString.h.

static orxINLINE orxSTRING orxString_UpperCase ( orxSTRING  _zString)
static

Uppercase a string

Parameters
[in]_zStringString To convert
Returns
The converted string.

Definition at line 1300 of file orxString.h.


Generated for orx by doxygen 1.8.11