/* * toPythonString.hpp * * Created on: Aug 26, 2013 * Author: heber */ #ifndef TOPYTHONSTRING_HPP_ #define TOPYTHONSTRING_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include class element; struct KeyValuePair; class RealSpaceMatrix; class Vector; template inline const std::string toPythonString( const T& _value) { std::stringstream output; output << _value; return output.str(); } template inline const std::string toPythonString( const T *& _value) { std::stringstream output; output << toPythonString(*_value); return output.str(); } template inline const std::string toPythonString( const T * _value) { std::stringstream output; output << toPythonString(*_value); return output.str(); } template inline const std::string toPythonString( const std::vector& _values) { std::stringstream output; for (typename std::vector::const_iterator iter = _values.begin(); iter != _values.end(); ++iter) { const T& _value = *iter; if (iter != _values.begin()) output << " "; output << toPythonString(_value); } return output.str(); } template <> const std::string toPythonString( const element & _value); template <> const std::string toPythonString( const boost::filesystem::path & _value); template <> const std::string toPythonString( const KeyValuePair& _value); template <> const std::string toPythonString( const RealSpaceMatrix& _value); template <> const std::string toPythonString( const Vector& _value); #endif /* TOPYTHONSTRING_HPP_ */