MCPcopy Create free account
hub / github.com/SmingHub/Sming / printCars

Function printCars

samples/Basic_Templates/app/application.cpp:32–44  ·  view source on GitHub ↗

* Demonstrate use of custom Template class using CSV source data. * Records are filtered by the template. */

Source from the content-addressed store, hash-verified

30 * Records are filtered by the template.
31 */
32void printCars()
33{
34 // Set up our templating class
35 CsvTemplate tmpl(new FSTR::Stream(Resource::cars_txt), // The template source
36 new FileStream(Filename::cars_csv) // The CSV data source
37 );
38
39 // Set the variable used by the template to filter records
40 tmpl.setVar("make_filter", "Volkswagen");
41
42 // Dump result to terminal
43 Serial.copyFrom(&tmpl);
44}
45
46/*
47 * Demonstrate using callbacks instead of CsvTemplate class,

Callers 1

initFunction · 0.85

Calls 2

setVarMethod · 0.80
copyFromMethod · 0.45

Tested by

no test coverage detected