24#ifndef JSON_READER_INCLUDED
25#define JSON_READER_INCLUDED
33#include <rapidjson/document.h>
34#include <rapidjson/schema.h>
45 std::vector<std::pair<std::pair<meta::Metadata, data::Data>,
46 std::unique_ptr<Json_data_extension>>>;
71 Json_reader(
const std::string schema,
const std::string data,
72 const std::string version_key =
"version",
73 const std::string array_key =
"elements");
105 std::unique_ptr<Json_data_extension> &json_data_extension)
const;
Sensitive data storage.
Definition: data.h:40
Base Json_reader.
Definition: json_reader.h:69
virtual ~Json_reader()=default
Destructor.
std::string version() const
Get version info.
Definition: json_reader.cc:118
bool valid() const
Definition: json_reader.h:118
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:133
virtual bool get_elements(output_vector &output) const
Get all elements.
Definition: json_reader.cc:151
size_t num_elements() const
Get number of elements in the document.
Definition: json_reader.cc:128
rapidjson::Document document_
Data in JSON DOM format.
Definition: json_reader.h:122
const std::string version_key_
Version key.
Definition: json_reader.h:124
Json_reader()
Definition: json_reader.cc:110
const std::string array_key_
user specific elements array key
Definition: json_reader.h:126
bool valid_
Validity of the data.
Definition: json_reader.h:128
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:46
Definition: keyring_encryption_service_definition.h:32