- removed polymorphic reflection, made static_reflect default because there are cases such as deserializing an array that you need more information than the runtime reflection can provide such as the ability to resize arrays and know the array content type. - refactored iostream, sstream, fstream to be much simpler, fewer indirections, and fixed getline. - json parsing works using code from mace. - value is reimplemented based upon mace::rpc::value and no longer uses the runtime reflection that was removed. - moved the typename utility to its own header
26 lines
1.3 KiB
C++
26 lines
1.3 KiB
C++
#include <fc/lexical_cast.hpp>
|
|
#include <boost/lexical_cast.hpp>
|
|
namespace fc {
|
|
|
|
namespace detail {
|
|
double to_double( const fc::string& s ) {
|
|
return boost::lexical_cast<double>(s.c_str());
|
|
}
|
|
int64_t to_int64( const fc::string& s ) {
|
|
return boost::lexical_cast<int64_t>(s.c_str());
|
|
}
|
|
uint64_t to_uint64( const fc::string& s ) {
|
|
return boost::lexical_cast<uint64_t>(s.c_str());
|
|
}
|
|
fc::string to_string( double d ){ return boost::lexical_cast<std::string>(d); }
|
|
fc::string to_string( uint64_t d ){ return boost::lexical_cast<std::string>(d); }
|
|
fc::string to_string( uint32_t d ){ return boost::lexical_cast<std::string>(d); }
|
|
fc::string to_string( uint16_t d ){ return boost::lexical_cast<std::string>(d); }
|
|
fc::string to_string( uint8_t d ){ return boost::lexical_cast<std::string>(d); }
|
|
fc::string to_string( int64_t d ){ return boost::lexical_cast<std::string>(d); }
|
|
fc::string to_string( int32_t d ){ return boost::lexical_cast<std::string>(d); }
|
|
fc::string to_string( int16_t d ){ return boost::lexical_cast<std::string>(d); }
|
|
fc::string to_string( int8_t d ){ return boost::lexical_cast<std::string>(d); }
|
|
fc::string to_string( char d ){ return boost::lexical_cast<std::string>(d); }
|
|
}
|
|
}
|