* Demonstrate use of custom Template class using CSV source data. * Records are filtered by the template. */
| 30 | * Records are filtered by the template. |
| 31 | */ |
| 32 | void 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, |