MCPcopy Create free account
hub / github.com/boostorg/json / read_json

Function read_json

test/doc_parsing.cpp:164–178  ·  view source on GitHub ↗

---------------------------------------------------------- tag::doc_parsing_10[]

Source from the content-addressed store, hash-verified

162//----------------------------------------------------------
163// tag::doc_parsing_10[]
164value read_json( std::istream& is, boost::system::error_code& ec )
165{
166 stream_parser p;
167 std::string line;
168 while( std::getline( is, line ) )
169 {
170 p.write( line, ec );
171 if( ec )
172 return nullptr;
173 }
174 p.finish( ec );
175 if( ec )
176 return nullptr;
177 return p.release();
178}
179// end::doc_parsing_10[]
180
181// tag::doc_parsing_14[]

Callers

nothing calls this directly

Calls 3

finishMethod · 0.80
writeMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected