24#ifndef JSON_READER_INCLUDED
25#define JSON_READER_INCLUDED
31#define RAPIDJSON_HAS_STDSTRING 1
35#include <rapidjson/document.h>
36#include <rapidjson/schema.h>
47 std::vector<std::pair<std::pair<meta::Metadata, data::Data>,
48 std::unique_ptr<Json_data_extension>>>;
73 Json_reader(
const std::string schema,
const std::string data,
74 const std::string version_key =
"version",
75 const std::string array_key =
"elements");
107 std::unique_ptr<Json_data_extension> &json_data_extension)
const;
Sensitive data storage.
Definition: data.h:40
Base Json_reader.
Definition: json_reader.h:71
virtual ~Json_reader()=default
Destructor.
std::string version() const
Get version info.
Definition: json_reader.cc:118
bool valid() const
Definition: json_reader.h:120
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:124
const std::string version_key_
Version key.
Definition: json_reader.h:126
Json_reader()
Definition: json_reader.cc:110
const std::string array_key_
user specific elements array key
Definition: json_reader.h:128
bool valid_
Validity of the data.
Definition: json_reader.h:130
Define rapidjson::SizeType to be std::size_t.
std::vector< std::pair< std::pair< meta::Metadata, data::Data >, std::unique_ptr< Json_data_extension > > > output_vector
Definition: json_reader.h:48
Definition: keyring_encryption_service_definition.h:32