xrpld
Loading...
Searching...
No Matches
JsonPropertyStream.h
1#pragma once
2
3#include <xrpl/beast/utility/PropertyStream.h>
4#include <xrpl/json/json_value.h>
5
6#include <string>
7#include <vector>
8
9namespace xrpl {
10
15{
16public:
17 json::Value topValue; // TODO: rename: clashes with top() method
19
20public:
22 [[nodiscard]] json::Value const&
23 top() const;
24
25protected:
26 void
27 mapBegin() override;
28 void
29 mapBegin(std::string const& key) override;
30 void
31 mapEnd() override;
32 void
33 add(std::string const& key, short value) override;
34 void
35 add(std::string const& key, unsigned short value) override;
36 void
37 add(std::string const& key, int value) override;
38 void
39 add(std::string const& key, unsigned int value) override;
40 void
41 add(std::string const& key, long value) override;
42 void
43 add(std::string const& key, float v) override;
44 void
45 add(std::string const& key, double v) override;
46 void
47 add(std::string const& key, std::string const& v) override;
48 void
49 arrayBegin() override;
50 void
51 arrayBegin(std::string const& key) override;
52 void
53 arrayEnd() override;
54
55 void
56 add(short value) override;
57 void
58 add(unsigned short value) override;
59 void
60 add(int value) override;
61 void
62 add(unsigned int value) override;
63 void
64 add(long value) override;
65 void
66 add(float v) override;
67 void
68 add(double v) override;
69 void
70 add(std::string const& v) override;
71};
72
73} // namespace xrpl
Abstract stream with RAII containers that produce a property tree.
Represents a JSON value.
Definition json_value.h:117
json::Value const & top() const
void add(std::string const &key, short value) override
std::vector< json::Value * > stack
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5