Export as JSON array.
More...
#include <remwharead/export/json.hpp>
Export as JSON array.
- Since
- 0.8.0
◆ ExportBase()
remwharead::Export::ExportBase::ExportBase |
|
explicit |
Export list of Database::entry.
- Parameters
-
const 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::JSON::print |
( |
| ) |
const |
|
overridevirtual |
Print output to std::ostream.
Implements remwharead::Export::ExportBase.
31 Poco::JSON::Array root = Poco::JSON::Array();
35 Poco::JSON::Object json_entry = Poco::JSON::Object();
37 json_entry.set(
"uri", entry.uri);
38 json_entry.set(
"archive_uri", entry.archive_uri);
39 json_entry.set(
"datetime", timepoint_to_string(entry.datetime));
40 Poco::JSON::Array tags = Poco::JSON::Array();
41 for (
const string &tag : entry.tags)
45 json_entry.set(
"tags", tags);
46 json_entry.set(
"title", entry.title);
47 json_entry.set(
"description", entry.description);
48 json_entry.set(
"fulltext", entry.fulltext);
56 catch (std::exception &e)
58 cerr <<
"Error in " << __func__ <<
": " << e.what() << endl;
struct remwharead::Database::entry entry
Describes a database entry.
The documentation for this class was generated from the following files:
- include/export/json.hpp
- src/lib/export/json.cpp