Utils.h File Reference

#include <string>
#include <sstream>

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.

Namespaces

namespace  utils

Functions

template<class T>
bool from_string (T &t, const std::string &s)
template<class T>
std::string to_string (const T &t)
void utils::replace (std::string &where, const std::string &what, const std::string &by)
bool utils::start_with (const std::string &str, const std::string &what)
bool utils::end_with (const std::string &str, const std::string &what)


Function Documentation

template<class T>
bool from_string ( T &  t,
const std::string &  s 
) [inline]

Definition at line 25 of file Utils.h.

00025                                            {
00026     std::istringstream iss(s, std::istringstream::in);
00027     return !(iss >> t).fail();  
00028 }

template<class T>
std::string to_string ( const T &  t  )  [inline]

Definition at line 31 of file Utils.h.

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


Generated on Wed Feb 27 20:31:27 2008 for php.ast.svn.src. by  doxygen 1.5.3