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

Go to the source code of this file.

Classes

struct  reusex::core::ResourceKey
struct  reusex::core::LeksikonField
 One top-level leksikon property, in leksikon (MaterialEPAS section) order. More...
class  reusex::core::KeyValueError
 A write the catalogue refuses: unknown key, read-only key, or a value the key's type does not accept. More...

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).

Enumerations

enum class  reusex::core::KeySource { reusex::core::builtin , reusex::core::leksikon , reusex::core::column }
 Where a key's value lives. More...
enum class  reusex::core::KeyScope { reusex::core::type , reusex::core::part }
 What a write changes: the survey type (all its parts) or the one part. More...

Functions

std::string_view reusex::core::to_string (KeyScope)
std::vector< LeksikonField > reusex::core::leksikon_fields ()
 Nested object-array fields (dangerous substances, emissions) are skipped: they are rows, not one value.
std::vector< std::string > reusex::core::leksikon_categories ()
 Distinct categories of leksikon_fields(), in order.
std::vector< ResourceKey > reusex::core::builtin_keys ()
 the 11 sys: keys, spec order
std::vector< ResourceKey > reusex::core::leksikon_keys ()
ResourceKey reusex::core::column_key (const ProjectDB::PropertyDefinition &def)
std::vector< ResourceKey > reusex::core::key_catalogue (const std::vector< ProjectDB::PropertyDefinition > &columns)
 Built-in, then leksikon, then user columns (in the given order) — the "catalogue order" template categories expand in.
std::vector< ResourceKey > reusex::core::key_catalogue (const ProjectDB &db)
const ResourceKey * reusex::core::find_key (const std::vector< ResourceKey > &catalogue, std::string_view id)
 nullptr when id is not in catalogue.
std::optional< double > reusex::core::parse_number (std::string_view text)
 Finite number with '.
std::string reusex::core::format_number (double v)
 Shortest round-trip text: 290.0 -> "290", 0.1 -> "0.1".
std::optional< std::string > reusex::core::normalise_value (const ResourceKey &key, const std::optional< std::string > &value)
 Validate value for key and return it normalised for storage (numbers with '.

Variables

constexpr std::string_view reusex::core::kBuiltinCategory = "Kortlægning"
constexpr std::string_view reusex::core::kColumnCategory = "Egne felter"