fix bugs parsing json tokens

This commit is contained in:
Daniel Larimer 2014-05-15 13:52:21 -04:00
parent 271fe8b909
commit c27ea9ba13
2 changed files with 11 additions and 5 deletions

View file

@ -119,9 +119,12 @@ namespace fc
in.get();
return token.str();
default:
std::cerr<<c;
if( isalnum( c ) )
{
token << c;
in.get();
}
else return token.str();
}
}
return token.str();
@ -265,7 +268,8 @@ namespace fc
template<typename T>
variant token_from_stream( T& in )
{
fc::stringstream ss;
std::stringstream ss;
ss.exceptions( std::ifstream::badbit );
bool parsed_unexpected_character = false;
bool received_eof = false;
try

View file

@ -9,11 +9,13 @@ namespace fc {
public:
impl( fc::string&s )
:ss( s )
{ }
{ ss.exceptions( std::stringstream::badbit | std::stringstream::eofbit ); }
impl( const fc::string&s )
:ss( s )
{ }
impl(){}
{ ss.exceptions( std::stringstream::badbit | std::stringstream::eofbit ); }
impl(){ss.exceptions( std::stringstream::badbit | std::stringstream::eofbit ); }
std::stringstream ss;
};