ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
resource_export.hpp File Reference
#include "reusex/core/ProjectDB.hpp"
#include "reusex/core/resource_keys.hpp"
#include "reusex/core/resource_templates.hpp"
#include "reusex/core/resources.hpp"
#include <cstddef>
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
Include dependency graph for resource_export.hpp:

Go to the source code of this file.

Classes

struct  reusex::core::ResourceTable
struct  reusex::core::ResourceReportSection

Namespaces

namespace  reusex
namespace  reusex::core
 Wire form of one stored report PDF version — the ReportPdfVersion schema in ruxd's API contract (docs/gui/openapi.yaml, in the ruxd repo).

Functions

std::string reusex::core::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, unset as "".
std::string reusex::core::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), then RFC 4180 quoting when it holds the delimiter, a quote, CR or LF.
std::vector< std::string > reusex::core::csv_labels (const std::vector< ResourceKey > &columns)
 The CSV header labels of columns: each key's label, with " (<category>)" appended to every label that occurs more than once (counting the "Kode" column), so no two headers read the same.
std::string reusex::core::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::string reusex::core::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::vector< ResourceTable > reusex::core::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 "<sys:name> · <code>" (sys:name is not repeated among the others).
ResourceReportSection reusex::core::resource_report_section (const ProjectDB &db, int64_t template_id)
 The PDF's Ressourcetabel for one template: every resource whose type is not rejected, by code.

Variables

constexpr std::string_view reusex::core::kCsvCodeLabel = "Kode"
 The leading resource-code column of the CSV: its header in label mode and in key mode.
constexpr std::string_view reusex::core::kCsvCodeKey = "code"
constexpr std::size_t reusex::core::kResourceTableMaxColumns = 8