String class to avoid std::string in the interfaceThis class helps avoiding std::string being present in exposed C++ interface, eventually resulting in compile/link errors when dynamically loading modules. More...
Public Member Functions | |
virtual OpenViBE::boolean | set (const OpenViBE::CString &rString) |
Initializes this string from another OpenViBE string. More... | |
virtual OpenViBE::boolean | set (const char *pString) |
Initializes this string from an ANSI/ASCII string. More... | |
virtual const char * | toASCIIString (void) const |
Converts this string to an ANSI/ASCII string. More... | |
virtual unsigned int | length (void) const |
Returns length of the string. More... | |
Constructor / Destructor | |
CString (void) | |
Default constructor. More... | |
CString (const OpenViBE::CString &rString) | |
Copy constructor. More... | |
CString (const char *pString) | |
Constructor based on ASCII strings. More... | |
virtual | ~CString (void) |
Destructor. More... | |
Protected Attributes | |
OpenViBE::CStringImpl * | m_pStringImpl |
The string implementation. | |
Operators | |
operator const char * (void) const | |
ASCII string cast operator. More... | |
OpenViBE::CString & | operator= (const OpenViBE::CString &rString) |
Affectation operator (copy) More... | |
char & | operator[] (unsigned int idx) |
Array subscription operator. More... | |
OV_API const OpenViBE::CString | operator+ (const OpenViBE::CString &rString1, const OpenViBE::CString &rString2) |
Addition operator. More... | |
OV_API OpenViBE::boolean | operator== (const OpenViBE::CString &rString1, const OpenViBE::CString &rString2) |
Equality comparison operator. More... | |
OV_API OpenViBE::boolean | operator!= (const OpenViBE::CString &rString1, const OpenViBE::CString &rString2) |
Inequality comparison operator. More... | |
OV_API OpenViBE::boolean | operator< (const OpenViBE::CString &rString1, const OpenViBE::CString &rString2) |
Order comparison operator (necessary to use CString as a key in a stl map) More... | |
Detailed Description
String class to avoid std::string in the interface
This class helps avoiding std::string being present in exposed C++ interface, eventually resulting in compile/link errors when dynamically loading modules.
- Date
- 2006-08-10
- Note
- The implementation uses std::string of course :)
Constructor & Destructor Documentation
CString | ( | void | ) |
Default constructor.
Initializes the string to an empty string.
CString | ( | const OpenViBE::CString & | rString | ) |
Copy constructor.
- Parameters
-
rString [in] : The string to copy
Copies the content of rString
into the new string.
CString | ( | const char * | pString | ) |
Constructor based on ASCII strings.
- Parameters
-
pString [in] : The string to copy
Copies the content of pString
into the new string.
|
virtual |
Destructor.
The destructor releases the std::string implementation !
Member Function Documentation
operator const char * | ( | void | ) | const |
ASCII string cast operator.
- Returns
- The string formatted as standard ASCII string used in C.
The implementation simply calls c_str()
.
OpenViBE::CString& operator= | ( | const OpenViBE::CString & | rString | ) |
Affectation operator (copy)
- Parameters
-
rString [in] : The string to copy
- Returns
- This string.
char& operator[] | ( | unsigned int | idx | ) |
Array subscription operator.
- Parameters
-
idx [in] : Index in the array
|
virtual |
|
virtual |
Initializes this string from an ANSI/ASCII string.
- Parameters
-
pString [in] : the ANSI/ASCII string to initialize this string from
- Returns
- true in case of success.
- false in case of error.
|
virtual |
Converts this string to an ANSI/ASCII string.
- Returns
- the ANSI/ASCII converted string.
|
virtual |
Returns length of the string.
- Returns
- Length of the string
Friends And Related Function Documentation
|
friend |
Addition operator.
- Parameters
-
rString1 [in] : The first part of the resulting string rString2 [in] : The second part of the resulting string
- Returns
- The concatenation of
rString1
andrString2
.
|
friend |
Equality comparison operator.
- Parameters
-
rString1 [in] : The first part of the resulting string rString2 [in] : The second part of the resulting string
- Returns
- true is
rString1
is exactly rString2. - false in other case.
- Note
- This is case sensitive !
|
friend |
Inequality comparison operator.
- Parameters
-
rString1 [in] : The first part of the resulting string rString2 [in] : The second part of the resulting string
- Returns
- false is
rString1
is exactly rString2. - true in other case.
- Note
- This is case sensitive !
|
friend |
Order comparison operator (necessary to use CString as a key in a stl map)
- Parameters
-
rString1 [in] : The first part of the resulting string rString2 [in] : The second part of the resulting string
- Returns
- false is
rString1
is exactly rString2. - true in other case.
- Note
- This is case sensitive !
Generated on Tue Jun 26 2012 15:25:54 for Documentation by
