24#ifndef JSON_WRITER_INCLUDED
25#define JSON_WRITER_INCLUDED
29#define RAPIDJSON_HAS_STDSTRING 1
33#include <rapidjson/document.h>
34#include <rapidjson/stringbuffer.h>
35#include <rapidjson/writer.h>
48 const std::string version_key =
"version",
49 const std::string array_key =
"elements");
54 bool set_data(
const std::string data);
Sensitive data storage.
Definition: data.h:40
Definition: json_writer.h:45
const std::string version_key_
Version information.
Definition: json_writer.h:93
bool set_data(const std::string data)
Definition: json_writer.cc:66
bool valid() const
Validity of the document.
Definition: json_writer.h:87
virtual ~Json_writer()=default
Destructor.
const std::string array_key_
Elements array name.
Definition: json_writer.h:95
rapidjson::Document document_
Data in JSON DOM format.
Definition: json_writer.h:91
size_t num_elements() const
Number of elements stored.
Definition: json_writer.cc:151
Json_writer(const std::string data={}, const std::string version="1.0", const std::string version_key="version", const std::string array_key="elements")
Constructor.
Definition: json_writer.cc:40
const std::string to_string() const
Get string representation of the JSON document.
Definition: json_writer.cc:72
virtual bool add_element(const meta::Metadata &metadata, const data::Data &data, Json_data_extension &)
Add an element.
Definition: json_writer.cc:81
bool valid_
Document validity.
Definition: json_writer.h:97
virtual bool remove_element(const meta::Metadata &metadata, const Json_data_extension &)
Remove an element.
Definition: json_writer.cc:125
Define rapidjson::SizeType to be std::size_t.
Definition: keyring_encryption_service_definition.h:32
required uint64 version
Definition: replication_group_member_actions.proto:41