CSIBCString Class Reference
General purpose string class.
More...#include <SIBCString.h>
List of all members.
Detailed Description
General purpose string class.
This class is used throughout the Crosswalk SDK as a standard method in dealing with strings. The strings are NULL-terminated strings. It supports many methods that perform useful string operations.
Constructor & Destructor Documentation
Default Constructor. Constructs an empty string (length zero).
Copy Constructor. Constructs a string idential to in_pString
- Parameters:
-
| [in] |
in_pString |
String to duplicate. Must not be of zero length. |
Constructor Constructs a string object containing the NULL-terminated character string pointer to by in_pString.
- Parameters:
-
| [in] |
in_pString |
Pointer to the string to use for the new string. Cannot be NULL. |
Member Function Documentation
Returns the length of the string.
- Returns:
- length of the string.
Returns a character buffer with the contents of the string. This buffer should not be modified, and does not need to be freed after use. This function is generally used to output the text contained within the string.
- Returns:
- Pointer to a character buffer containing the string text.
- Example:
- Demonstrating good and bad usage of GetText
SIBCString * t_pMyString = new SIBCString("Crosswalk SDK");
printf("I think that %s is the best!\n", t_pMyString->GetText());
printf("I think that %s is the best!\n", t_pMyString);
Deletes the internal character buffer of the string, and sets the length to zero.
Concatenate in_pString to the end of this string.
- Parameters:
-
| [in] |
in_pString |
Pointer to the string to concatenate. |
- Return values:
-
| SI_Error Concat |
( |
const SI_Char * |
in_pString |
) |
|
Concatenate in_pString to the end of this string.
- Parameters:
-
| [in] |
in_pString |
Pointer to a character buffer to concatenate. |
- Return values:
-
| SI_Error Concat |
( |
const SI_Int |
in_lInt |
) |
|
Concatenate in_lInt to the end of this string, in string format.
- Parameters:
-
| [in] |
in_lInt |
Integer to concatenate to the end of this string. |
- Return values:
-
- Example:
- Demonstrates how to concatenate integers with a string
SIBCString * t_pMyString = SIBCString("Crosswalk v");
t_pMyString->Concat(3);
t_pMyString->Concat(".");
t_pMyString->Concat(6);
printf("This is %s\n", t_pMyString.GetText());
| SI_Error Concat |
( |
const SI_Float |
in_fFloat |
) |
|
Concatenate in_fFloat to the end of this string, in string format.
- Parameters:
-
| [in] |
in_fFloat |
Floating-point number to concatenate to the end of this string. |
- Return values:
-
- Example:
- Demonstrates how to concatenate floats with a string
SIBCString * t_pMyString = SIBCString("Crosswalk v");
t_pMyString->Concat(3.6f);
printf("This is %s\n", t_pMyString.GetText());
Assigns the value contained in the string in_pString to this string.
- Parameters:
-
| [in] |
in_pString |
String containing data to assign to this string. |
- Return values:
-
| SI_Error SetText |
( |
const SI_Char * |
in_pString |
) |
|
Assigns the NULL-terminated string contained in the character buffer in_pString to this string.
- Parameters:
-
| [in] |
in_pString |
Pointer to the character buffer containing the NULL-terminated string to assign. |
- Return values:
-
| SI_Error SetText |
( |
const SI_Int |
in_lInt |
) |
|
Assigns the string representation of in_lInt to this string.
- Parameters:
-
| [in] |
in_lInt |
Integer whose string representation should be assigned to this string |
- Return values:
-
| SI_Error SetText |
( |
const SI_Float |
in_fFloat |
) |
|
Assigns the string representation of in_fFloat to this string.
- Parameters:
-
| [in] |
in_fFloat |
Floating-point number whose string representation should be assigned to this string |
- Return values:
-
Returns a value indicating the lexicographic difference between this string and in_pString. Negative values indicate this string is less than in_pString, Positive values indicate this string is greater than in_pString, and zero values indicate the strings are the same.
- Parameters:
-
| [in] |
in_pString |
The string to compare this string with. |
- Return values:
-
|
|
\c |
<positive_integer_value> indicating the difference when this string is greater than in_pString |
|
|
\c |
<negative_integer_value> indicating the difference when this string is less than in_pString |
|
|
\c |
0 if in_pString and this string are the same (including when both buffers are NULL) |
|
|
\c |
1 if in_pString's buffer is NULL and this string's buffer is not NULL |
|
|
\c |
-1 if this string's buffer is NULL and in_pString's buffer is not NULL |
| SI_Int Compare |
( |
const SI_Char * |
in_pString |
) |
|
Returns a value indicating the lexicographic difference between this string and in_pString. Negative values indicate this string is less than in_pString, Positive values indicate this string is greater than in_pString, and zero values indicate the strings are the same.
- Parameters:
-
| [in] |
in_pString |
The string to compare this string with. |
- Return values:
-
|
|
\c |
<positive_integer_value> indicating the difference when this string is greater than in_pString |
|
|
\c |
<negative_integer_value> indicating the difference when this string is less than in_pString |
|
|
\c |
0 if in_pString and this string are the same (including when both buffers are NULL) |
|
|
\c |
0 if in_pString and this string's buffers are NULL |
|
|
\c |
1 if in_pString's buffer is NULL and this string's buffer is not NULL |
|
|
\c |
-1 if this string's buffer is NULL and in_pString's buffer is not NULL |
| SI_Int Compare |
( |
const SI_Int |
in_lInt |
) |
|
Returns a value indicating the differences between this string and the string representation of in_lInt.
- Parameters:
-
| [in] |
in_lInt |
The integer value whose string representation is compared with this string. |
- Return values:
-
|
|
\c |
<positive_integer_value> indicating the difference when this string is greater than in_lInt |
|
|
\c |
<negative_integer_value> indicating the difference when this string is less than in_lInt |
|
|
\c |
0 if in_lInt and this string are the same |
| SI_Int Compare |
( |
const SI_Float |
in_fFloat |
) |
|
Returns a value indicated the differences between this string and the string representation of in_fFloat.
- Parameters:
-
| [in] |
in_fFloat |
The floating-pointer number whose string representation is compared with this string. |
- Return values:
-
|
|
\c |
<positive_integer_value> indicating the difference when this string is greater than in_fFloat |
|
|
\c |
<negative_integer_value> indicating the difference when this string is less than in_fFloat |
|
|
\c |
0 if in_fFloat and this string are the same |
Converts all alphabetic characters contained within this string to lower-case characters.
- Return values:
-
Converts all alphabetic characters contained within this string to upper-case characters.
- Return values:
-
Removes all characters considered illegal by Softimage
- Returns:
- success/failure
| SI_Bool IsXSILegalName |
( |
|
) |
|
Returns whether the string is a legal Softimage name
- Return values:
-
Assignment operator. Copies the value of i_pString into this string.
- Parameters:
-
| [in] |
i_pString |
String whose value is copied into this string. |
- Returns:
- Reference to this string.
Assignment operator. Copies the value of i_pString into this string.
- Parameters:
-
| [in] |
i_pString |
Pointer to the character buffer containing a NULL-terminated string whose value is copied into this string. |
- Returns:
- Reference to this string.
Equality operator. Determines whether i_pString and this string contain the same text.
- Parameters:
-
| [in] |
i_pString |
Reference to the string to compare to. |
- Return values:
-
|
|
true |
if strings contain the same text |
|
|
false |
otherwise |
| bool operator== |
( |
const SI_Char * |
i_pString |
) |
|
Equality operator. Determines whether i_pString and this string contain the same text.
- Parameters:
-
| [in] |
i_pString |
Pointer to the character buffer containing the NULL-terminated string to compare to. |
- Return values:
-
|
|
true |
if strings contain the same text |
|
|
false |
otherwise |
Inequality operator. Determines whether i_pString and this string contain different text.
- Parameters:
-
| [in] |
i_pString |
Reference to the string to compare to. |
- Return values:
-
|
|
true |
if string contain different text |
|
|
false |
otherwise |
Outputs debugging information for this string. This includes the address of the string, the length and contents of the string buffer.
Returns the amount of memory used by the string. This does not include the size of the SIBCString class, only the data contained in its character buffer. In SIBCString (but not necessarily in other classes) SIBCString::UsedMemory is equivalent to SIBCString::AllocatedMemory.
- Returns:
- Amount of memory used by this string (in bytes).
| SI_UInt AllocatedMemory |
( |
|
) |
|
Returns the amount of memory allocated by the string. This does not include the size of the SIBCString class, only the data contained in its character buffer. In SIBCString (but not necessarily in other classes) SIBCString::AllocatedMemory is equivalent to SIBCString::UsedMemory.
- Returns:
- Amount of memory used by this string (in bytes).
The documentation for this class was generated from the following file: