24#ifndef JSON_READER_INCLUDED
25#define JSON_READER_INCLUDED
33#include <rapidjson/document.h>
34#include <rapidjson/schema.h>
44 std::vector<std::pair<std::pair<meta::Metadata, data::Data>,
45 std::unique_ptr<Json_data_extension>>>;
70 Json_reader(
const std::string &schema,
const std::string &data,
71 std::string version_key =
"version",
72 std::string array_key =
"elements");
109 std::unique_ptr<Json_data_extension> &json_data_extension)
const;
130 std::string
property(
const std::string property_key)
const;
Sensitive data storage.
Definition: data.h:39
Base Json_reader.
Definition: json_reader.h:68
virtual ~Json_reader()=default
Destructor.
std::string version() const
Get version info.
Definition: json_reader.h:86
bool valid() const
Definition: json_reader.h:122
virtual bool get_element(size_t index, meta::Metadata &metadata, data::Data &data, std::unique_ptr< Json_data_extension > &json_data_extension) const
Fetch element from given position.
Definition: json_reader.cc:132
virtual bool get_elements(output_vector &output) const
Get all elements.
Definition: json_reader.cc:150
size_t num_elements() const
Get number of elements in the document.
Definition: json_reader.cc:127
rapidjson::Document document_
Data in JSON DOM format.
Definition: json_reader.h:134
const std::string version_key_
Version key.
Definition: json_reader.h:136
Json_reader()
Definition: json_reader.cc:107
const std::string array_key_
user specific elements array key
Definition: json_reader.h:138
bool valid_
Validity of the data.
Definition: json_reader.h:140
std::string property(const std::string property_key) const
Get property from the main JSON object.
Definition: json_reader.cc:117
Define rapidjson::SizeType to be std::uint64_t.
std::vector< std::pair< std::pair< meta::Metadata, data::Data >, std::unique_ptr< Json_data_extension > > > output_vector
Definition: json_reader.h:45