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

Function read_write_csv_tasks

examples/src/csv_examples.cpp:200–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200void read_write_csv_tasks()
201{
202 std::ifstream is("./input/tasks.csv");
203
204 jsoncons::json_decoder<jsoncons::ojson> decoder;
205 auto options = csv::csv_options{}
206 .assume_header(true)
207 .trim(true)
208 .ignore_empty_values(true)
209 .column_types("integer,string,string,string");
210 csv::csv_stream_reader reader(is,decoder,options);
211 reader.read();
212 auto tasks = decoder.get_result();
213
214 std::cout << "(1)\n";
215 std::cout << pretty_print(tasks) << "\n\n";
216
217 std::cout << "(2)\n";
218 csv::csv_stream_encoder encoder(std::cout);
219 tasks.dump(encoder);
220}
221
222void serialize_array_of_arrays_to_comma_delimited()
223{

Callers 1

mainFunction · 0.85

Calls 8

pretty_printFunction · 0.85
column_typesMethod · 0.80
ignore_empty_valuesMethod · 0.80
trimMethod · 0.80
assume_headerMethod · 0.80
get_resultMethod · 0.80
readMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected