//------------------------------------------------------------------------------ std::string read_until_eof(std::istream& is) { std::string result; const std::ios_base::fmtflags saved = is.flags(); is.unsetf(std::ios::skipws); std::copy(std::istream_iterator<char>(is), std::istream_iterator<char>(), std::back_inserter(result)); is.flags(saved); return result; }
void json::parse( std::istream &in ) { auto flags = in.flags(); in.unsetf( std::ios_base::skipws ); std::istream_iterator<char> it( in ); std::istream_iterator<char> end; int line = 1; parse_value( it, end, line ); in.flags( flags ); }
resetter(std::istream& is) : is_(is), f_(is.flags()) {}