11#include "reusex/core/ProjectDB.hpp"
12#include "reusex/core/resource_keys.hpp"
13#include "reusex/core/resource_templates.hpp"
14#include "reusex/core/resources.hpp"
28 const std::optional<std::string> &value);
32std::string
csv_cell(std::string_view value, std::string_view delimiter);
40std::vector<std::string>
csv_labels(
const std::vector<ResourceKey> &columns);
46 const std::vector<Resource> &rows,
54 std::vector<std::vector<std::string>>
rows;
60std::vector<ResourceTable>
62 const std::vector<Resource> &rows,
Wire form of one stored report PDF version — the ReportPdfVersion schema in ruxd's API contract (docs...
std::vector< std::string > csv_labels(const std::vector< ResourceKey > &columns)
The CSV header labels of columns: each key's label, with " (<category>)" appended to every label that...
std::string csv_cell(std::string_view value, std::string_view delimiter)
One CSV cell: a cell starting with = + - @ TAB or CR gets a leading ' (formula injection),...
constexpr std::string_view kCsvCodeLabel
The leading resource-code column of the CSV: its header in label mode and in key mode.
std::string build_resource_csv(const std::vector< ResourceKey > &columns, const std::vector< Resource > &rows, const CsvOptions &options)
Header + one CRLF-terminated row per resource, led by the resource code.
std::vector< ResourceTable > resource_tables(const std::vector< ResourceKey > &columns, const std::vector< Resource > &rows, std::size_t max_columns=kResourceTableMaxColumns)
Wrap columns into tables of at most max_columns, each led by a "Betegnelse" column whose cell is "<sy...
std::string export_resources_csv(const ProjectDB &db, int64_t template_id)
The CSV for one template: its resolved keys, every resource by code, its CSV options.
std::string display_value(const ResourceKey &key, const std::optional< std::string > &value)
A value as a reader sees it: treatment and miljøstatus as their Danish labels, booleans as Ja/Nej,...
ResourceReportSection resource_report_section(const ProjectDB &db, int64_t template_id)
The PDF's Ressourcetabel for one template: every resource whose type is not rejected,...
constexpr std::string_view kCsvCodeKey
constexpr std::size_t kResourceTableMaxColumns
A template's CSV export options (templates.csv).
std::vector< ResourceTable > tables
std::string template_name
std::vector< std::string > headers
std::vector< std::vector< std::string > > rows