Raytrix Light Field SDK
5.0
|
Basic character string operations.
Inherits Rx::Interop::Runtime30::IMemoryAccess.
Public Member Functions | |
CRxString () | |
Default constructor. More... | |
CRxString (const char *pcString) | |
Creates a CRxString consisting of string pcString. More... | |
CRxString (const char cChar) | |
Creates a CRxString consisting of character cChar. More... | |
CRxString (const CRxString &sxString) | |
Copy constructor. More... | |
CRxString (const Interop::Runtime30::IMemory *pSrcMem) | |
Creates a CRxString consisting of pSrcMem interpreted as character array. More... | |
CRxString (CRxString &&sxString) | |
Move constructor. More... | |
CRxString (size_t nSize) | |
Creates an empty string with the given size. More... | |
virtual | ~CRxString () |
Destructor. More... | |
void | Assign (const char *pcData, size_t nNumChars) |
Assigns a new value to the string, replacing its current contents. 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... | |
const char * | Data () const |
Returns a pointer to an array that contains a null-terminated sequence of characters (i.e., a C-string) representing the current value of the string object. 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 |
size_t | GetElementSize () const override |
Gets the size in bytes of an element of a string, which is always 1. More... | |
const void * | GetPointer () const override |
Gets the pointer to memory. More... | |
bool | IsValid () const override |
Query if this object is valid. More... | |
size_t | Length () const override |
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+= (double dValue) |
Appends the given double to this CRxString. More... | |
CRxString & | operator+= (float fValue) |
Appends the given float to this CRxString. More... | |
CRxString & | operator+= (int iValue) |
Appends the given integer to this CRxString. More... | |
CRxString & | operator+= (int64_t iValue) |
Appends the given integer to this CRxString. More... | |
CRxString & | operator+= (uint32_t uValue) |
Appends the given unsigned integer to this CRxString. More... | |
CRxString & | operator+= (uint64_t nValue) |
Addition assignment operator. More... | |
bool | operator< (const CRxString &sxString) const |
Less-than comparison 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<< (CRxStringPrecision &xPrecision) |
CRxString & | operator<< (double dValue) |
Appends the given double to this CRxString. More... | |
CRxString & | operator<< (float fValue) |
Appends the given float to this CRxString. More... | |
CRxString & | operator<< (int32_t uValue) |
Appends the given unsigned integer to this CRxString. More... | |
CRxString & | operator<< (int64_t iValue) |
Appends the given __int64 element to the string. More... | |
CRxString & | operator<< (NUMBER_PRESENTAION::ID ePresentation) |
CRxString & | operator<< (uint32_t nValue) |
Appends the given size_t element to the string. More... | |
CRxString & | operator<< (uint64_t nValue) |
Appends the given size_t element to the string. More... | |
CRxString & | operator= (const char *pcString) |
Assignment operator. More... | |
CRxString & | operator= (const char cChar) |
Assignment operator. More... | |
CRxString & | operator= (const CRxString &sxString) |
Assignment operator. More... | |
CRxString & | operator= (const Interop::Runtime30::IMemoryAccess *pSrcMem) |
Assignment operator. More... | |
CRxString & | operator= (CRxString &&sxString) |
Move 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... | |
bool | StartsWith (const CRxString &sxString) const |
Determines whether the start of this string instance matches the specified string. 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... | |
double | ToDoubleFromHex () const |
Converts this hexadecimal string with 16 chars to a 8 byte double variable. More... | |
int | ToInt () const |
Converts this CRxString to an int. More... | |
int64_t | ToInt64FromHex () const |
Converts this hexadecimal string to a 64-bit integer value. More... | |
unsigned | ToUInt () const |
Converts this CRxString to an unsigned int. More... | |
uint64_t | ToUInt64 () const |
Converts this CRxString to a 64-bit unsigned int. More... | |
uint64_t | ToUInt64FromHex () const |
Converts this hexadecimal string to a 64-bit unsigned value. More... | |
unsigned | ToUIntFromHex () const |
Converts this hexadecimal string to an unsigned value. More... | |
Static Public Member Functions | |
static CRxString | ToHexString (double dVal) |
Convert a 8 byte double variable into a hexadecimal string representation with 16 chars. 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 | ( | size_t | nSize | ) |
Creates an empty string with the given size.
nSize | The size in bytes. |
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 | ( | CRxString && | sxString | ) |
Move constructor.
sxString | [in,out] The Raytrix string. Is invalid after this call. |
Rx::CRxString::CRxString | ( | const Interop::Runtime30::IMemory * | pSrcMem | ) |
Creates a CRxString consisting of pSrcMem interpreted as character array.
pSrcMem | Source memory. |
|
virtual |
Destructor.
void Rx::CRxString::Assign | ( | const char * | pcData, |
size_t | nNumChars | ||
) |
Assigns a new value to the string, replacing its current contents.
Copies the first nNumChars characters from the array of characters pointed by pcData.
pcData | Pointer to an array of characters. |
nNumChars | Number of characters to copy. |
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 |
const char* Rx::CRxString::Data | ( | ) | const |
Returns a pointer to an array that contains a null-terminated sequence of characters (i.e., a C-string) representing the current value of the string object.
This array includes the same sequence of characters that make up the value of the string object plus an additional terminating null-character ('\0') at the end.
The pointer returned points to the internal array currently used by the string object to store the characters that conform its value.
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 |
|
overridevirtual |
Gets the size in bytes of an element of a string, which is always 1.
Implements Rx::Interop::Runtime30::IMemoryAccess.
|
overridevirtual |
Gets the pointer to memory.
Implements Rx::Interop::Runtime30::IMemoryAccess.
|
overridevirtual |
Query if this object is valid.
Implements Rx::Interop::Runtime30::IMemoryAccess.
|
overridevirtual |
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+= | ( | double | dValue | ) |
CRxString& Rx::CRxString::operator+= | ( | float | fValue | ) |
CRxString& Rx::CRxString::operator+= | ( | int | iValue | ) |
CRxString& Rx::CRxString::operator+= | ( | int64_t | iValue | ) |
CRxString& Rx::CRxString::operator+= | ( | uint32_t | uValue | ) |
CRxString& Rx::CRxString::operator+= | ( | uint64_t | nValue | ) |
Addition assignment operator.
nValue | The unsigned __int64 value. |
bool Rx::CRxString::operator< | ( | const CRxString & | sxString | ) | const |
Less-than comparison operator.
sxString | The string to compare with. |
CRxString& Rx::CRxString::operator<< | ( | const char * | pcString | ) |
CRxString& Rx::CRxString::operator<< | ( | CRxStringPrecision & | xPrecision | ) |
CRxString& Rx::CRxString::operator<< | ( | double | dValue | ) |
CRxString& Rx::CRxString::operator<< | ( | float | fValue | ) |
CRxString& Rx::CRxString::operator<< | ( | int32_t | uValue | ) |
CRxString& Rx::CRxString::operator<< | ( | int64_t | iValue | ) |
Appends the given __int64 element to the string.
iValue | The value. |
CRxString& Rx::CRxString::operator<< | ( | NUMBER_PRESENTAION::ID | ePresentation | ) |
CRxString& Rx::CRxString::operator<< | ( | uint32_t | nValue | ) |
Appends the given size_t element to the string.
nValue | The value. |
CRxString& Rx::CRxString::operator<< | ( | uint64_t | nValue | ) |
Appends the given size_t element to the string.
nValue | The value. |
CRxString& Rx::CRxString::operator= | ( | const char * | pcString | ) |
Assignment operator.
pcString | The string. |
CRxString& Rx::CRxString::operator= | ( | const char | cChar | ) |
Assignment operator.
cChar | The character. |
Assignment operator.
sxString | The Raytrix string. |
CRxString& Rx::CRxString::operator= | ( | const Interop::Runtime30::IMemoryAccess * | pSrcMem | ) |
Assignment operator.
pSrcMem | Source memory. |
Move assignment operator.
sxString | [in,out] The Raytrix string. Is invalid after this call. |
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. |
bool Rx::CRxString::StartsWith | ( | const CRxString & | sxString | ) | const |
Determines whether the start of this string instance matches the specified string.
sxString | The string to compare to the substring at the start of this instance. |
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 |
double Rx::CRxString::ToDoubleFromHex | ( | ) | const |
Converts this hexadecimal string with 16 chars to a 8 byte double variable.
|
static |
Convert a 8 byte double variable into a hexadecimal string representation with 16 chars.
dVal | The double value. |
int Rx::CRxString::ToInt | ( | ) | const |
int64_t Rx::CRxString::ToInt64FromHex | ( | ) | const |
Converts this hexadecimal string to a 64-bit integer value.
unsigned Rx::CRxString::ToUInt | ( | ) | const |
uint64_t Rx::CRxString::ToUInt64 | ( | ) | const |
uint64_t Rx::CRxString::ToUInt64FromHex | ( | ) | const |
Converts this hexadecimal string to a 64-bit unsigned value.
unsigned Rx::CRxString::ToUIntFromHex | ( | ) | const |
Converts this hexadecimal string to an unsigned value.
|
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.