OpenViBE Documentation

CString Class Reference
[Base framework]

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. More...

List of all members.

Public Member Functions

virtual OpenViBE::boolean set (const OpenViBE::CString &rString)
 Initializes this string from another OpenViBE string.
virtual OpenViBE::boolean set (const char *pString)
 Initializes this string from an ANSI/ASCII string.
virtual const char * toASCIIString (void) const
 Converts this string to an ANSI/ASCII string.
Constructor / Destructor


 CString (void)
 Default constructor.
 CString (const OpenViBE::CString &rString)
 Copy constructor.
 CString (const char *pString)
 Constructor based on ASCII strings.
virtual ~CString (void)
 Destructor.

Protected Attributes

OpenViBE::CStringImpl * m_pStringImpl
 The string implementation.

Operators



 operator const char * (void) const
 ASCII string cast operator.
OpenViBE::CStringoperator= (const OpenViBE::CString &rString)
 Affectation operator (copy).
OV_API const OpenViBE::CString operator+ (const OpenViBE::CString &rString1, const OpenViBE::CString &rString2)
 Addition operator.
OV_API OpenViBE::boolean operator== (const OpenViBE::CString &rString1, const OpenViBE::CString &rString2)
 Equality comparison operator.
OV_API OpenViBE::boolean operator!= (const OpenViBE::CString &rString1, const OpenViBE::CString &rString2)
 Inequality comparison operator.
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).


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.

Author:
Yann Renard (INRIA/IRISA)
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 ~CString ( void   )  [virtual]

Destructor.

The destructor releases the std::string implementation !


Member Function Documentation

operator const char * ( void   )  const

ASCII string cast operator.

Returns:
The string formated 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.

virtual OpenViBE::boolean set ( const OpenViBE::CString rString  )  [virtual]

Initializes this string from another OpenViBE string.

Parameters:
rString [in] : the OpenViBE string to initialize this string from
Returns:
true in case of success.

false in case of error.

virtual OpenViBE::boolean set ( const char *  pString  )  [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 const char* toASCIIString ( void   )  const [virtual]

Converts this string to an ANSI/ASCII string.

Returns:
the ANSI/ASCII converted string.


Friends And Related Function Documentation

OV_API const OpenViBE::CString operator+ ( const OpenViBE::CString rString1,
const OpenViBE::CString rString2 
) [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 and rString2.

OV_API OpenViBE::boolean operator== ( const OpenViBE::CString rString1,
const OpenViBE::CString rString2 
) [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 !

OV_API OpenViBE::boolean operator!= ( const OpenViBE::CString rString1,
const OpenViBE::CString rString2 
) [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 !

OV_API OpenViBE::boolean operator< ( const OpenViBE::CString rString1,
const OpenViBE::CString rString2 
) [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 !