Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

tostring.h File Reference

#include <string>
#include <sstream>

Include dependency graph for tostring.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  Dv
namespace  Dv::Util

Functions

template<typename T> std::string tostring (const T &t)
 A function that converts anything that can be written to a stream to a string (using the ostringstream class).
template<typename T> bool fromstring (T &t, const std::string &s)
 A function that converts anything that can be read from a stream to a string (using the istringstream class).


Function Documentation

template<typename T>
std::string tostring const T &  t  ) 
 

A function that converts anything that can be written to a stream to a string (using the ostringstream class).

Parameters:
t object for which a string representation is sought.
Returns:
a string representation of t.
Definition at line 18 of file tostring.h.

Referenced by Dv::Util::enum_parser< E >::enum2str().

template<typename T>
bool fromstring T &  t,
const std::string &  s
 

A function that converts anything that can be read from a stream to a string (using the istringstream class).

Parameters:
t object for which a string representation is sought.
s string representation from which t is to be computed
Returns:
true iff success
Definition at line 35 of file tostring.h.


dvutil-0.13.15 [30 December, 2004]