MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / decode_csv_stream

Function decode_csv_stream

examples/src/csv_examples.cpp:378–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378void decode_csv_stream()
379{
380 const std::string bond_yields = R"(Date,1Y,2Y,3Y,5Y
3812017-01-09,0.0062,0.0075,0.0083,0.011
3822017-01-08,0.0063,0.0076,0.0084,0.0112
3832017-01-07,0.0063,0.0076,0.0084,0.0112
384)";
385
386 auto options = csv::csv_options{}
387 .assume_header(true)
388 .column_types("string,float,float,float,float");
389
390 std::istringstream is(bond_yields);
391
392 auto j = csv::decode_csv<jsoncons::ojson>(is,options);
393
394 std::cout << pretty_print(j) << '\n';
395}
396
397void encode_csv_file_from_books()
398{

Callers 1

mainFunction · 0.85

Calls 3

pretty_printFunction · 0.85
column_typesMethod · 0.80
assume_headerMethod · 0.80

Tested by

no test coverage detected