#include <iostream>
#include <istream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
Go to the source code of this file.
Functions | |
template<typename T> | |
T | fromString (const std::string &s) |
read a variable of type T from a string representation s. | |
template<typename T> | |
std::string | toString (const T &t) |
store the string representation of variable t in string s. | |
template<typename T> | |
void | ReadVector (istream &is, std::vector< T > &tvec) |
template<typename T> | |
void | WriteVector (ostream &os, const std::vector< T > &tvec) |
char | upper (char c) |
|
This is a shortcut to read any type T from a string s. It is a C++ equivalent for sscanf. An example use is :
string s="123"; uint i=fromString<uint>(s); -> i=123 double x=fromSting<double>("3.145"); -> x=3.145 |
|
Read a vector. |
|
This is a shortcut to print any type T as a string s. It is a C++ equivalent for sprintf. An example use is :
uint i=123; string si=toString<uint>(i); -> si="123" string sd=toString<double>(3.145); -> sd="3.145" |
|
Convert a character to upper case. |
|
Write a vector. |