rippled
Loading...
Searching...
No Matches
JsonPropertyStream.cpp
1#include <xrpl/json/JsonPropertyStream.h>
2#include <xrpl/json/json_value.h>
3
4#include <string>
5
6namespace ripple {
7
13
14Json::Value const&
16{
17 return m_top;
18}
19
20void
28
29void
31{
32 // top is a map
35 m_stack.push_back(&map);
36}
37
38void
43
44void
46{
47 (*m_stack.back())[key] = v;
48}
49
50void
51JsonPropertyStream::add(std::string const& key, unsigned short v)
52{
53 (*m_stack.back())[key] = v;
54}
55
56void
58{
59 (*m_stack.back())[key] = v;
60}
61
62void
63JsonPropertyStream::add(std::string const& key, unsigned int v)
64{
65 (*m_stack.back())[key] = v;
66}
67
68void
70{
71 (*m_stack.back())[key] = int(v);
72}
73
74void
76{
77 (*m_stack.back())[key] = v;
78}
79
80void
82{
83 (*m_stack.back())[key] = v;
84}
85
86void
88{
89 (*m_stack.back())[key] = v;
90}
91
92void
100
101void
103{
104 // top is a map
106 Json::Value& vec(top[key] = Json::arrayValue);
107 m_stack.push_back(&vec);
108}
109
110void
115
116void
118{
119 m_stack.back()->append(v);
120}
121
122void
123JsonPropertyStream::add(unsigned short v)
124{
125 m_stack.back()->append(v);
126}
127
128void
130{
131 m_stack.back()->append(v);
132}
133
134void
136{
137 m_stack.back()->append(v);
138}
139
140void
142{
143 m_stack.back()->append(int(v));
144}
145
146void
148{
149 m_stack.back()->append(v);
150}
151
152void
154{
155 m_stack.back()->append(v);
156}
157
158void
163
164} // namespace ripple
T back(T... args)
Represents a JSON value.
Definition json_value.h:130
Value & append(Value const &value)
Append value to array at the end.
Json::Value const & top() const
void add(std::string const &key, short value) override
std::vector< Json::Value * > m_stack
JSON (JavaScript Object Notation).
Definition json_errors.h:6
@ arrayValue
array value (ordered list)
Definition json_value.h:25
@ objectValue
object value (collection of name/value pairs).
Definition json_value.h:26
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
T pop_back(T... args)
T push_back(T... args)
T reserve(T... args)