RobWorkProject  24.5.15-
Public Member Functions | List of all members
XMLStr Class Reference

Utility class to help convert between Xerces unicode XMLCh* and ordinary C/C++ strings. More...

#include <XercesUtils.hpp>

Public Member Functions

 XMLStr (const char *const str)
 Constructs from char array.
 
 XMLStr (const std::string &str)
 Constructs from std::string.
 
 XMLStr (double value)
 Constructs from double. More...
 
 XMLStr (int value)
 Constructs from int. More...
 
 XMLStr (bool value)
 Constructs from bool. More...
 
 XMLStr (const XMLCh *ch)
 Constructs from unicode string.
 
 ~XMLStr ()
 Destructor.
 
const XMLCh * uni () const
 Returns the unicode value. More...
 
std::string str () const
 Returns std::string from unicode. More...
 
 XMLStr (const XMLStr &xmlstr)
 

Detailed Description

Utility class to help convert between Xerces unicode XMLCh* and ordinary C/C++ strings.

The class makes sure to clean up pointers

Constructor & Destructor Documentation

◆ XMLStr() [1/3]

XMLStr ( double  value)
inline

Constructs from double.

The methods uses an ordinary sprintf to convert into ch*, which are then converted to unicode.

◆ XMLStr() [2/3]

XMLStr ( int  value)
inline

Constructs from int.

The methods uses an ordinary sprintf to convert into ch*, which are then converted to unicode.

◆ XMLStr() [3/3]

XMLStr ( bool  value)
inline

Constructs from bool.

The methods convert true into the text "true" and false into "false"

Member Function Documentation

◆ str()

std::string str ( ) const
inline

Returns std::string from unicode.

Only defined when the object is constructed using XMLStr(const XMLCh* ch).

◆ uni()

const XMLCh* uni ( ) const
inline

Returns the unicode value.

If constructed with XMLStr(const XMLCh* ch) no conversion has appeared and the method returns NULL


The documentation for this class was generated from the following file: