fix bugs parsing json tokens
This commit is contained in:
parent
271fe8b909
commit
c27ea9ba13
2 changed files with 11 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue