DigitalSpaces::Variant::getStringVisitor Struct Reference

Inherits boost::static_visitor< const char * >.


Detailed Description

An anything-to-string converter, for getString.

Todo:
This needs further development, to allow more automatic to-string conversion.

Public Member Functions

 getStringVisitor (std::string &scratchSpace)
 Constructor that prepares the _scratchSpace.
template<typename T>
const char * operator() (const T &) const
 Generic implementation that attempts to use boost::lexical_cast to perform the conversion.
Conversion specific overrides
For data types that can't (or shouldn't) be converted using boost::lexical_cast.

template<>
const char * operator() (const std::string &value) const
template<>
const char * operator() (const SettingMap &) const
template<>
const char * operator() (const boost::blank &) const
template<>
const char * operator() (const Wml::Vector3f &value) const
template<>
const char * operator() (const Wml::Vector4f &value) const
template<>
const char * operator() (const Wml::Quaternionf &value) const

Data Fields

std::string & _scratchSpace
 Reference to a extenrally allocated string, for use as storage space for converted values.

Constructor & Destructor Documentation

DigitalSpaces::Variant::getStringVisitor::getStringVisitor ( std::string &  scratchSpace  )  [inline]

Constructor that prepares the _scratchSpace.


Member Function Documentation

template<typename T>
const char* DigitalSpaces::Variant::getStringVisitor::operator() ( const T &   )  const [inline]

Generic implementation that attempts to use boost::lexical_cast to perform the conversion.

template<>
const char* DigitalSpaces::Variant::getStringVisitor::operator() ( const std::string &  value  )  const [inline]

template<>
const char* DigitalSpaces::Variant::getStringVisitor::operator() ( const SettingMap  )  const [inline]

template<>
const char* DigitalSpaces::Variant::getStringVisitor::operator() ( const boost::blank &   )  const [inline]

template<>
const char* DigitalSpaces::Variant::getStringVisitor::operator() ( const Wml::Vector3f value  )  const [inline]

template<>
const char* DigitalSpaces::Variant::getStringVisitor::operator() ( const Wml::Vector4f value  )  const [inline]

template<>
const char* DigitalSpaces::Variant::getStringVisitor::operator() ( const Wml::Quaternionf value  )  const [inline]


Field Documentation

Reference to a extenrally allocated string, for use as storage space for converted values.


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

Generated on Sun Aug 31 17:46:32 2008 for Digital Spaces by  doxygen 1.5.6