Newer
Older
*
* Created on: Apr 1, 2013
* Author: Jan Travnicek
*/
#include <sstream>
namespace std {
template < >
string to_string ( const string & value ) {
return value;
template < >
string from_string ( const string & value ) {
return value;
template < >
int from_string ( const string & value ) {
return stoi__private ( value.c_str() );
}
template < >
bool from_string ( const string & value ) {
if ( value == "true" || value == "1" )
return true;
else
return false;
}
template < >
long from_string ( const string & value ) {
return stol__private ( value.c_str() );
}
template < >
long long from_string ( const string & value ) {
return stoll__private ( value.c_str() );
}
template < >
unsigned from_string ( const string & value ) {
return stoul__private ( value.c_str() );
template < >
unsigned long from_string ( const string & value ) {
return stoul__private ( value.c_str() );
}
template < >
unsigned long long from_string ( const string & value ) {
return stoull__private ( value.c_str() );
}
template < >
double from_string ( const string & value ) {
return stod__private ( value.c_str() );
}
string cstringToString ( char * param ) {
string res ( param );
free ( param );
return res;