Export as Comma Separated Values.
More...
#include <remwharead/export/csv.hpp>
Export as Comma Separated Values.
- Since
- 0.6.0
◆ ExportBase()
remwharead::Export::ExportBase::ExportBase |
|
explicit |
Export list of Database::entry.
- Parameters
-
list< Database::entry > sort_entries(list< Database::entry > entries) const
Sort entries from newest to oldest and remove duplicates.
Definition: export.cpp:30
◆ print()
void remwharead::Export::CSV::print |
( |
| ) |
const |
|
overridevirtual |
Print output to std::ostream.
Implements remwharead::Export::ExportBase.
29 _out << R
"("URI","Archived URI","Date & time","Tags",)" 30 << R"("Title","Description","Full text")" << "\r\n";
31 for (
const Database::entry &entry : _entries)
34 for (
const string &tag : entry.tags)
37 if (tag != *(entry.tags.rbegin()))
42 _out <<
'"' << quote(entry.uri) <<
"\",\"" 43 << quote(entry.archive_uri) <<
"\",\"" 44 << timepoint_to_string(entry.datetime) <<
"\",\"" 45 << quote(strtags) <<
"\",\"" 46 << quote(entry.title) <<
"\",\"" 47 << quote(entry.description) <<
"\",\"" 48 << quote(entry.fulltext_oneline()) <<
'"'<<
"\r\n";
51 catch (std::exception &e)
53 cerr <<
"Error in " << __func__ <<
": " << e.what() << endl;
The documentation for this class was generated from the following files:
- include/export/csv.hpp
- src/lib/export/csv.cpp