rippled
Loading...
Searching...
No Matches
JsonPropertyStream.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_JSON_JSONPROPERTYSTREAM_H_INCLUDED
21#define RIPPLE_JSON_JSONPROPERTYSTREAM_H_INCLUDED
22
23#include <xrpl/beast/utility/PropertyStream.h>
24#include <xrpl/json/json_value.h>
25
26namespace ripple {
27
30{
31public:
34
35public:
37 Json::Value const&
38 top() const;
39
40protected:
41 void
42 map_begin() override;
43 void
44 map_begin(std::string const& key) override;
45 void
46 map_end() override;
47 void
48 add(std::string const& key, short value) override;
49 void
50 add(std::string const& key, unsigned short value) override;
51 void
52 add(std::string const& key, int value) override;
53 void
54 add(std::string const& key, unsigned int value) override;
55 void
56 add(std::string const& key, long value) override;
57 void
58 add(std::string const& key, float v) override;
59 void
60 add(std::string const& key, double v) override;
61 void
62 add(std::string const& key, std::string const& v) override;
63 void
64 array_begin() override;
65 void
66 array_begin(std::string const& key) override;
67 void
68 array_end() override;
69
70 void
71 add(short value) override;
72 void
73 add(unsigned short value) override;
74 void
75 add(int value) override;
76 void
77 add(unsigned int value) override;
78 void
79 add(long value) override;
80 void
81 add(float v) override;
82 void
83 add(double v) override;
84 void
85 add(std::string const& v) override;
86};
87
88} // namespace ripple
89
90#endif
Represents a JSON value.
Definition json_value.h:149
Abstract stream with RAII containers that produce a property tree.
A PropertyStream::Sink which produces a Json::Value of type objectValue.
Json::Value const & top() const
void add(std::string const &key, short value) override
std::vector< Json::Value * > m_stack
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25