Basic character string operations.
Inherits Rx::Interop::Runtime30::IMemoryAccess.
Public Member Functions | |
CRxString () | |
Default constructor. More... | |
CRxString (const char cChar) | |
Creates a CRxString consisting of character cChar. More... | |
CRxString (const char *pcString) | |
Creates a CRxString consisting of string pcString. More... | |
CRxString (const CRxString &sxString) | |
Copy constructor. More... | |
CRxString (const Rx::Interop::Runtime30::IMemory *pSrcMem) | |
Creates a CRxString consisting of pSrcMem interpreted as character array. More... | |
virtual | ~CRxString () |
Destructor. More... | |
bool | Contains (const char *pcString) const |
Query if this CRxString contains the given pcString. More... | |
bool | Contains (const CRxString &sxString) const |
Query if this CRxString contains the given sxString. More... | |
bool | EndsWith (const CRxString &sxString) const |
Determines whether the end of this string instance matches the specified string. More... | |
size_t | Find (const char *pcString, size_t nStartIdx=0) const |
Searches this string for the content specified in either pcString or sxString, and returns the position of the first occurrence in this string. More... | |
size_t | Find (const CRxString &sxString, size_t nStartIdx=0) const |
size_t | FindFirstNotOf (const char *pcWhat, size_t nStartIdx=0, size_t nCount=CRxString::npos) const |
size_t | FindFirstOf (const char *pcWhat, size_t nStartIdx=0, size_t nCount=CRxString::npos) const |
Searches the string for the first character that matches any of the characters specified in its arguments. More... | |
size_t | FindLastNotOf (const char *pcWhat, size_t nStartIdx=CRxString::npos, size_t nCount=CRxString::npos) const |
size_t | FindLastOf (const char *pcWhat, size_t nStartIdx=CRxString::npos, size_t nCount=CRxString::npos) const |
virtual size_t | GetElementSize () const |
Gets the size in bytes of an element of a string, which is always 1. More... | |
virtual const void * | GetPointer () const |
Gets the pointer to memory. More... | |
virtual bool | IsValid () const |
Query if this object is valid. More... | |
virtual size_t | Length () const |
Gets the length of this CRxString. This is the number of characters. More... | |
bool | operator!= (const char *pcString) const |
Inequality operator. More... | |
bool | operator!= (const CRxString &sxString) const |
Inequality operator. More... | |
CRxString & | operator+= (const char *pcString) |
Appends the given string to this CRxString. More... | |
CRxString & | operator+= (const CRxString &sxString) |
Appends the given string to this CRxString. More... | |
CRxString & | operator+= (int iValue) |
Appends the given integer to this CRxString. More... | |
CRxString & | operator+= (__int64 iValue) |
Appends the given integer to this CRxString. More... | |
CRxString & | operator+= (unsigned __int32 uValue) |
Appends the given unsigned integer to this CRxString. More... | |
CRxString & | operator+= (unsigned __int64 nValue) |
Addition assignment operator. More... | |
CRxString & | operator+= (unsigned long ulValue) |
Addition assignment operator. More... | |
CRxString & | operator+= (float fValue) |
Appends the given float to this CRxString. More... | |
CRxString & | operator+= (double dValue) |
Appends the given double to this CRxString. More... | |
CRxString & | operator<< (const char *pcString) |
Appends the given string to this CRxString. More... | |
CRxString & | operator<< (const CRxString &sxString) |
Appends the given string to this CRxString. More... | |
CRxString & | operator<< (int iValue) |
Appends the given integer to this CRxString. More... | |
CRxString & | operator<< (__int64 iValue) |
Appends the given __int64 element to the string. More... | |
CRxString & | operator<< (unsigned __int32 uValue) |
Appends the given unsigned integer to this CRxString. More... | |
CRxString & | operator<< (unsigned __int64 nValue) |
Appends the given size_t element to the string. More... | |
CRxString & | operator<< (unsigned long ulValue) |
Appends the given size_t element to the string. More... | |
CRxString & | operator<< (float fValue) |
Appends the given float to this CRxString. More... | |
CRxString & | operator<< (double dValue) |
Appends the given double to this CRxString. More... | |
CRxString & | operator<< (CRxStringFormatPrecision &xPrecision) |
CRxString & | operator<< (Rx::NUMBER_PRESENTAION::ID ePresentation) |
CRxString & | operator= (const char cChar) |
Assignment operator. More... | |
CRxString & | operator= (const char *pcString) |
Assignment operator. More... | |
CRxString & | operator= (const CRxString &sxString) |
Assignment operator. More... | |
CRxString & | operator= (const Rx::Interop::Runtime30::IMemoryAccess *pSrcMem) |
Assignment operator. More... | |
bool | operator== (const char *pcString) const |
Equality operator. More... | |
bool | operator== (const CRxString &sxString) const |
Equality operator. More... | |
char | operator[] (size_t nIndex) const |
Gets the nIndex-th character from string. More... | |
CRxString | Replace (const char *pcOld, const char *pcNew) const |
Replaces all occurrences of pcOld by pcNew and returns the resulting CRxString. More... | |
void | SplitFilename (CRxString &sxDirectory, CRxString &sxName, CRxString &sxExtension) const |
Assumes that this CRxString represents a file name and splits it in path, name and extension. More... | |
CRxString | SubStr (size_t nStartIdx, size_t nCount=CRxString::npos) const |
Returns a newly constructed CRxString object with its value initialized to a copy of a substring of this object. More... | |
const char * | ToCString () const |
Converts this CRxString to a c string. More... | |
int | ToInt () const |
Converts this CRxString to an int. More... | |
unsigned | ToUInt () const |
Converts this CRxString to an unsigned int. More... | |
Static Public Attributes | |
static const size_t | npos |
npos is a static member constant value with the greatest possible value for an element of type size_t. More... | |
Rx::CRxString::CRxString | ( | ) |
Default constructor.
Rx::CRxString::CRxString | ( | const char | cChar | ) |
Creates a CRxString consisting of character cChar.
cChar | The character. |
Rx::CRxString::CRxString | ( | const char * | pcString | ) |
Creates a CRxString consisting of string pcString.
pcString | The string. |
Rx::CRxString::CRxString | ( | const CRxString & | sxString | ) |
Copy constructor.
sxString | The Raytrix string. |
Rx::CRxString::CRxString | ( | const Rx::Interop::Runtime30::IMemory * | pSrcMem | ) |
Creates a CRxString consisting of pSrcMem interpreted as character array.
pSrcMem | Source memory. |
|
virtual |
Destructor.
bool Rx::CRxString::Contains | ( | const char * | pcString | ) | const |
Query if this CRxString contains the given pcString.
pcString | The string to test for containment. |
bool Rx::CRxString::Contains | ( | const CRxString & | sxString | ) | const |
bool Rx::CRxString::EndsWith | ( | const CRxString & | sxString | ) | const |
Determines whether the end of this string instance matches the specified string.
sxString | The string to compare to the substring at the end of this instance. |
size_t Rx::CRxString::Find | ( | const char * | pcString, |
size_t | nStartIdx = 0 |
||
) | const |
Searches this string for the content specified in either pcString or sxString, and returns the position of the first occurrence in this string.
When nStartIdx is specified the search only includes characters on or after position nStartIdx, ignoring any possible occurrences in previous locations.
pcString | String to be searched for in this string. The entire content of str must be matched in some part of the string to be considered a match. |
nStartIdx | (optional) Position of the first character in the string to be taken into consideration for possible matches. A value of 0 means that the entire string is considered. |
size_t Rx::CRxString::Find | ( | const CRxString & | sxString, |
size_t | nStartIdx = 0 |
||
) | const |
size_t Rx::CRxString::FindFirstNotOf | ( | const char * | pcWhat, |
size_t | nStartIdx = 0 , |
||
size_t | nCount = CRxString::npos |
||
) | const |
size_t Rx::CRxString::FindFirstOf | ( | const char * | pcWhat, |
size_t | nStartIdx = 0 , |
||
size_t | nCount = CRxString::npos |
||
) | const |
Searches the string for the first character that matches any of the characters specified in its arguments.
When nCount is specified, the search only includes characters at or after position nCount, ignoring any possible occurrences before nCount.
pcWhat | String containing the characters to search for in this string. |
nStartIdx | (optional) Position of the first character in the string to be taken into consideration for possible matches. |
nCount | (optional) Length of sequence of characters to search for. |
size_t Rx::CRxString::FindLastNotOf | ( | const char * | pcWhat, |
size_t | nStartIdx = CRxString::npos , |
||
size_t | nCount = CRxString::npos |
||
) | const |
size_t Rx::CRxString::FindLastOf | ( | const char * | pcWhat, |
size_t | nStartIdx = CRxString::npos , |
||
size_t | nCount = CRxString::npos |
||
) | const |
|
virtual |
Gets the size in bytes of an element of a string, which is always 1.
Implements Rx::Interop::Runtime30::IMemoryAccess.
|
virtual |
Gets the pointer to memory.
Implements Rx::Interop::Runtime30::IMemoryAccess.
|
virtual |
Query if this object is valid.
Implements Rx::Interop::Runtime30::IMemoryAccess.
|
virtual |
Gets the length of this CRxString. This is the number of characters.
Implements Rx::Interop::Runtime30::IMemoryAccess.
bool Rx::CRxString::operator!= | ( | const char * | pcString | ) | const |
Inequality operator.
pcString | The string. |
bool Rx::CRxString::operator!= | ( | const CRxString & | sxString | ) | const |
Inequality operator.
sxString | The string. |
CRxString& Rx::CRxString::operator+= | ( | const char * | pcString | ) |
CRxString& Rx::CRxString::operator+= | ( | int | iValue | ) |
CRxString& Rx::CRxString::operator+= | ( | __int64 | iValue | ) |
CRxString& Rx::CRxString::operator+= | ( | unsigned __int32 | uValue | ) |
CRxString& Rx::CRxString::operator+= | ( | unsigned __int64 | nValue | ) |
Addition assignment operator.
nValue | The unsigned __int64 value. |
CRxString& Rx::CRxString::operator+= | ( | unsigned long | ulValue | ) |
Addition assignment operator.
ulValue | The unsigned long value. |
CRxString& Rx::CRxString::operator+= | ( | float | fValue | ) |
CRxString& Rx::CRxString::operator+= | ( | double | dValue | ) |
CRxString& Rx::CRxString::operator<< | ( | const char * | pcString | ) |
CRxString& Rx::CRxString::operator<< | ( | int | iValue | ) |
CRxString& Rx::CRxString::operator<< | ( | __int64 | iValue | ) |
Appends the given __int64 element to the string.
iValue | The value. |
CRxString& Rx::CRxString::operator<< | ( | unsigned __int32 | uValue | ) |
CRxString& Rx::CRxString::operator<< | ( | unsigned __int64 | nValue | ) |
Appends the given size_t element to the string.
nValue | The value. |
CRxString& Rx::CRxString::operator<< | ( | unsigned long | ulValue | ) |
Appends the given size_t element to the string.
ulValue | The unsigned long value. |
CRxString& Rx::CRxString::operator<< | ( | float | fValue | ) |
CRxString& Rx::CRxString::operator<< | ( | double | dValue | ) |
CRxString& Rx::CRxString::operator<< | ( | CRxStringFormatPrecision & | xPrecision | ) |
CRxString& Rx::CRxString::operator<< | ( | Rx::NUMBER_PRESENTAION::ID | ePresentation | ) |
CRxString& Rx::CRxString::operator= | ( | const char | cChar | ) |
Assignment operator.
cChar | The character. |
CRxString& Rx::CRxString::operator= | ( | const char * | pcString | ) |
Assignment operator.
pcString | The string. |
Assignment operator.
sxString | The Raytrix string. |
CRxString& Rx::CRxString::operator= | ( | const Rx::Interop::Runtime30::IMemoryAccess * | pSrcMem | ) |
Assignment operator.
pSrcMem | Source memory. |
bool Rx::CRxString::operator== | ( | const char * | pcString | ) | const |
Equality operator.
pcString | The string. |
bool Rx::CRxString::operator== | ( | const CRxString & | sxString | ) | const |
Equality operator.
sxString | The string. |
char Rx::CRxString::operator[] | ( | size_t | nIndex | ) | const |
Gets the nIndex-th character from string.
nIndex | The index. |
CRxString Rx::CRxString::Replace | ( | const char * | pcOld, |
const char * | pcNew | ||
) | const |
void Rx::CRxString::SplitFilename | ( | CRxString & | sxDirectory, |
CRxString & | sxName, | ||
CRxString & | sxExtension | ||
) | const |
Assumes that this CRxString represents a file name and splits it in path, name and extension.
sxDirectory | [out] The directory path. |
sxName | [out] Name of file without extension. |
sxExtension | [out] Extension of file. |
CRxString Rx::CRxString::SubStr | ( | size_t | nStartIdx, |
size_t | nCount = CRxString::npos |
||
) | const |
Returns a newly constructed CRxString object with its value initialized to a copy of a substring of this object.
The substring is the portion of the object that starts at character position nStartIdx and spans nCount characters (or until the end of the string, whichever comes first).
nStartIdx | Position of the first character to be copied as a substring. If this is equal to the string length, the function returns an empty string. |
nCount | (Optional) Number of characters to include in the substring (if the string is shorter, as many characters as possible are used). A value of -1 indicates all characters until the end of the string. |
const char* Rx::CRxString::ToCString | ( | ) | const |
int Rx::CRxString::ToInt | ( | ) | const |
unsigned Rx::CRxString::ToUInt | ( | ) | const |
|
static |
npos is a static member constant value with the greatest possible value for an element of type size_t.
This value, when used as the value for a length parameter in string's member functions, means "until the end of the string".
As a return value, it is usually used to indicate no matches.
This constant is defined with a value of -1, which because size_t is an unsigned integral type, it is the largest possible representable value for this type.