Raytrix Light Field SDK  v3.1
Logo
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events Groups Pages
Rx::CRxString Class Reference

Detailed Description

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...
 
CRxStringoperator+= (const char *pcString)
 Appends the given string to this CRxString. More...
 
CRxStringoperator+= (const CRxString &sxString)
 Appends the given string to this CRxString. More...
 
CRxStringoperator+= (int iValue)
 Appends the given integer to this CRxString. More...
 
CRxStringoperator+= (__int64 iValue)
 Appends the given integer to this CRxString. More...
 
CRxStringoperator+= (unsigned __int32 uValue)
 Appends the given unsigned integer to this CRxString. More...
 
CRxStringoperator+= (unsigned __int64 nValue)
 Addition assignment operator. More...
 
CRxStringoperator+= (unsigned long ulValue)
 Addition assignment operator. More...
 
CRxStringoperator+= (float fValue)
 Appends the given float to this CRxString. More...
 
CRxStringoperator+= (double dValue)
 Appends the given double to this CRxString. More...
 
CRxStringoperator<< (const char *pcString)
 Appends the given string to this CRxString. More...
 
CRxStringoperator<< (const CRxString &sxString)
 Appends the given string to this CRxString. More...
 
CRxStringoperator<< (int iValue)
 Appends the given integer to this CRxString. More...
 
CRxStringoperator<< (__int64 iValue)
 Appends the given __int64 element to the string. More...
 
CRxStringoperator<< (unsigned __int32 uValue)
 Appends the given unsigned integer to this CRxString. More...
 
CRxStringoperator<< (unsigned __int64 nValue)
 Appends the given size_t element to the string. More...
 
CRxStringoperator<< (unsigned long ulValue)
 Appends the given size_t element to the string. More...
 
CRxStringoperator<< (float fValue)
 Appends the given float to this CRxString. More...
 
CRxStringoperator<< (double dValue)
 Appends the given double to this CRxString. More...
 
CRxStringoperator<< (CRxStringFormatPrecision &xPrecision)
 
CRxStringoperator<< (Rx::NUMBER_PRESENTAION::ID ePresentation)
 
CRxStringoperator= (const char cChar)
 Assignment operator. More...
 
CRxStringoperator= (const char *pcString)
 Assignment operator. More...
 
CRxStringoperator= (const CRxString &sxString)
 Assignment operator. More...
 
CRxStringoperator= (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...
 

Constructor & Destructor Documentation

Rx::CRxString::CRxString ( )

Default constructor.

Rx::CRxString::CRxString ( const char  cChar)

Creates a CRxString consisting of character cChar.

Parameters
cCharThe character.
Rx::CRxString::CRxString ( const char *  pcString)

Creates a CRxString consisting of string pcString.

Parameters
pcStringThe string.
Rx::CRxString::CRxString ( const CRxString sxString)

Copy constructor.

Parameters
sxStringThe Raytrix string.
Rx::CRxString::CRxString ( const Rx::Interop::Runtime30::IMemory pSrcMem)

Creates a CRxString consisting of pSrcMem interpreted as character array.

Parameters
pSrcMemSource memory.
virtual Rx::CRxString::~CRxString ( )
virtual

Destructor.

Member Function Documentation

bool Rx::CRxString::Contains ( const char *  pcString) const

Query if this CRxString contains the given pcString.

Parameters
pcStringThe string to test for containment.
Returns
true if this string contains the given pcString, false if not.
bool Rx::CRxString::Contains ( const CRxString sxString) const

Query if this CRxString contains the given sxString.

Parameters
sxStringThe CRxString to test for containment.
Returns
True if this string contains the given sString, false if not.
bool Rx::CRxString::EndsWith ( const CRxString sxString) const

Determines whether the end of this string instance matches the specified string.

Parameters
sxStringThe string to compare to the substring at the end of this instance.
Returns
True if value matches the end of this instance; otherwise, false.
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.

Parameters
pcStringString 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.
Returns
The position of the first occurrence in the string of the searched content. If the content is not found, the member value CRxString::npos is returned.
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.

Parameters
pcWhatString 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.
Returns
The position of the first occurrence in the string of any of the characters searched for. If the content is not found, the member value CRxString::npos is returned.
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 size_t Rx::CRxString::GetElementSize ( ) const
virtual

Gets the size in bytes of an element of a string, which is always 1.

Returns
The element size.

Implements Rx::Interop::Runtime30::IMemoryAccess.

virtual const void* Rx::CRxString::GetPointer ( ) const
virtual

Gets the pointer to memory.

Returns
The pointer to memory.

Implements Rx::Interop::Runtime30::IMemoryAccess.

virtual bool Rx::CRxString::IsValid ( ) const
virtual

Query if this object is valid.

Returns
True if valid, false if not.

Implements Rx::Interop::Runtime30::IMemoryAccess.

virtual size_t Rx::CRxString::Length ( ) const
virtual

Gets the length of this CRxString. This is the number of characters.

Returns
The length of this CRxString.

Implements Rx::Interop::Runtime30::IMemoryAccess.

bool Rx::CRxString::operator!= ( const char *  pcString) const

Inequality operator.

Parameters
pcStringThe string.
Returns
True if the parameters are not considered equivalent.
bool Rx::CRxString::operator!= ( const CRxString sxString) const

Inequality operator.

Parameters
sxStringThe string.
Returns
True if the parameters are not considered equivalent.
CRxString& Rx::CRxString::operator+= ( const char *  pcString)

Appends the given string to this CRxString.

Parameters
pcStringThe string.
Returns
The concatenation of this CRxString with pcString.
CRxString& Rx::CRxString::operator+= ( const CRxString sxString)

Appends the given string to this CRxString.

Parameters
sxStringThe string.
Returns
The concatenation of this CRxString with sxString.
CRxString& Rx::CRxString::operator+= ( int  iValue)

Appends the given integer to this CRxString.

Parameters
iValueThe integer.
Returns
The concatenation of this CRxString with iValue.
CRxString& Rx::CRxString::operator+= ( __int64  iValue)

Appends the given integer to this CRxString.

Parameters
iValueThe integer.
Returns
The concatenation of this CRxString with iValue.
CRxString& Rx::CRxString::operator+= ( unsigned __int32  uValue)

Appends the given unsigned integer to this CRxString.

Parameters
uValueThe unsigned integer.
Returns
The concatenation of this CRxString with uValue.
CRxString& Rx::CRxString::operator+= ( unsigned __int64  nValue)

Addition assignment operator.

Parameters
nValueThe unsigned __int64 value.
Returns
The concatenation of this CRxString with nValue.
CRxString& Rx::CRxString::operator+= ( unsigned long  ulValue)

Addition assignment operator.

Parameters
ulValueThe unsigned long value.
Returns
The concatenation of this CRxString with ulValue.
CRxString& Rx::CRxString::operator+= ( float  fValue)

Appends the given float to this CRxString.

Parameters
fValueThe float.
Returns
The concatenation of this CRxString with fValue.
CRxString& Rx::CRxString::operator+= ( double  dValue)

Appends the given double to this CRxString.

Parameters
dValueThe double.
Returns
The concatenation of this CRxString with dValue.
CRxString& Rx::CRxString::operator<< ( const char *  pcString)

Appends the given string to this CRxString.

Parameters
pcStringThe string.
Returns
The concatenation of this CRxString with pcString.
CRxString& Rx::CRxString::operator<< ( const CRxString sxString)

Appends the given string to this CRxString.

Parameters
sxStringThe string.
Returns
The concatenation of this CRxString with sxString.
CRxString& Rx::CRxString::operator<< ( int  iValue)

Appends the given integer to this CRxString.

Parameters
iValueThe integer.
Returns
The concatenation of this CRxString with iValue.
CRxString& Rx::CRxString::operator<< ( __int64  iValue)

Appends the given __int64 element to the string.

Parameters
iValueThe value.
Returns
This string object.
CRxString& Rx::CRxString::operator<< ( unsigned __int32  uValue)

Appends the given unsigned integer to this CRxString.

Parameters
uValueThe unsigned integer.
Returns
The concatenation of this CRxString with uValue.
CRxString& Rx::CRxString::operator<< ( unsigned __int64  nValue)

Appends the given size_t element to the string.

Parameters
nValueThe value.
Returns
This string object.
CRxString& Rx::CRxString::operator<< ( unsigned long  ulValue)

Appends the given size_t element to the string.

Parameters
ulValueThe unsigned long value.
Returns
This string object.
CRxString& Rx::CRxString::operator<< ( float  fValue)

Appends the given float to this CRxString.

Parameters
fValueThe float.
Returns
The concatenation of this CRxString with fValue.
CRxString& Rx::CRxString::operator<< ( double  dValue)

Appends the given double to this CRxString.

Parameters
dValueThe double.
Returns
The concatenation of this CRxString with 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.

Parameters
cCharThe character.
Returns
A CRxString consisting of character cChar.
CRxString& Rx::CRxString::operator= ( const char *  pcString)

Assignment operator.

Parameters
pcStringThe string.
Returns
A CRxString consisting of string pcString.
CRxString& Rx::CRxString::operator= ( const CRxString sxString)

Assignment operator.

Parameters
sxStringThe Raytrix string.
Returns
A CRxString consisting of Raytrix string sxString.
CRxString& Rx::CRxString::operator= ( const Rx::Interop::Runtime30::IMemoryAccess pSrcMem)

Assignment operator.

Parameters
pSrcMemSource memory.
Returns
A CRxString consisting of pSrcMem interpreted as character array.
bool Rx::CRxString::operator== ( const char *  pcString) const

Equality operator.

Parameters
pcStringThe string.
Returns
True if the parameters are considered equivalent.
bool Rx::CRxString::operator== ( const CRxString sxString) const

Equality operator.

Parameters
sxStringThe string.
Returns
True if the parameters are considered equivalent.
char Rx::CRxString::operator[] ( size_t  nIndex) const

Gets the nIndex-th character from string.

Parameters
nIndexThe index.
Returns
The indexed character.
CRxString Rx::CRxString::Replace ( const char *  pcOld,
const char *  pcNew 
) const

Replaces all occurrences of pcOld by pcNew and returns the resulting CRxString.

Parameters
pcOldString which should be replaced.
pcNewThis string is used as the replacement.
Returns
The replaced CRxString.
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.

Parameters
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).

Parameters
nStartIdxPosition 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.
Returns
A string object with a substring of this object.
const char* Rx::CRxString::ToCString ( ) const

Converts this CRxString to a c string.

Returns
This CRxString as a const char*.
int Rx::CRxString::ToInt ( ) const

Converts this CRxString to an int.

Returns
This CRxString as an int.
unsigned Rx::CRxString::ToUInt ( ) const

Converts this CRxString to an unsigned int.

Returns
This CRxString as an unsigned int.

Member Data Documentation

const size_t Rx::CRxString::npos
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.