utils.h File Reference

#include <string>
#include <sstream>
#include "smart_ptr.h"
#include "types.h"

Include dependency graph for utils.h:

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

Go to the source code of this file.

Functions

template<typename T >
std::string ToString (const T &Value)
template<typename T >
bool FromString (const std::string &String, T &Destination)
template<typename T >
void Swap (T &A, T &B)


Function Documentation

template<typename T >
std::string ToString ( const T &  Value  )  [inline]

Definition at line 30 of file utils.h.

00031 {
00032         std::ostringstream Oss;
00033         Oss << Value;
00034         return Oss.str();
00035 }

template<typename T >
bool FromString ( const std::string &  String,
T &  Destination 
) [inline]

Definition at line 37 of file utils.h.

00038 {
00039         std::istringstream Iss(String);
00040         return Iss >> Destination != 0;
00041 }

template<typename T >
void Swap ( T &  A,
T &  B 
) [inline]

Definition at line 44 of file utils.h.

00045 {
00046         T C(A);
00047         A = B;
00048         B = C;
00049 }


Generated on Tue Aug 30 02:36:50 2011 for Smacky by  doxygen 1.5.8