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

Function decode_csv_string

examples/src/csv_examples.cpp:363–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363void decode_csv_string()
364{
365 std::string s = R"(employee-no,employee-name,dept,salary
36600000001,\"Smith,Matthew\",sales,150000.00
36700000002,\"Brown,Sarah\",sales,89000.00
368)";
369
370 auto options = csv::csv_options{}
371 .assume_header(true)
372 .column_types("string,string,string,float");
373 auto j = csv::decode_csv<jsoncons::json>(s,options);
374
375 std::cout << pretty_print(j) << '\n';
376}
377
378void decode_csv_stream()
379{

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