Decentralised Art Server
High-performance C++ backend that exposes HTML interface and a secure REST API for managing Performative Transactions entities
Loading...
Searching...
No Matches
parser.hpp File Reference
#include <cstdint>
#include <string_view>
#include <nlohmann/json.hpp>
#include <google/protobuf/util/json_util.h>
#include "parse_error.hpp"

Go to the source code of this file.

Classes

struct  dcn::parse::use_protobuf_t
 A tag type to indicate whether to use Protobuf or JSON for parsing. More...
struct  dcn::parse::use_json_t
 A tag type to indicate whether to use Protobuf or JSON for parsing. More...

Namespaces

namespace  dcn
namespace  dcn::parse

Typedefs

using json = nlohmann::json

Functions

template<class T>
Result< T > dcn::parse::parseFromJson (json json, use_json_t)
 Converts a JSON string to a T using JSON.
template<class T>
Result< T > dcn::parse::parseFromJson (std::string json_str, use_protobuf_t)
 Converts a JSON string to a T using Protobuf.
template<class T>
Result< jsondcn::parse::parseToJson (T message, use_json_t)
 Converts a T to a JSON object using JSON.
template<class T>
Result< std::string > dcn::parse::parseToJson (T message, use_protobuf_t)
 Converts a T to a JSON string using Protobuf.
template<class T>
Result< T > dcn::parse::decodeBytes (const std::vector< uint8_t > &bytes)
Result< std::uint32_t > dcn::parse::parseUint32Decimal (std::string_view value)

Typedef Documentation

◆ json

using json = nlohmann::json