|
rippled
|
JSON (JavaScript Object Notation). More...
Namespaces | |
| namespace | detail |
Classes | |
| class | Compact |
| Decorator for streaming out compact json. More... | |
| class | DefaultValueAllocator |
| struct | DummyValueAllocatorInitializer |
| struct | error |
| class | FastWriter |
| Outputs a Value in JSON format without formatting (not human friendly). More... | |
| struct | JsonMissingKeyError |
| struct | JsonTypeMismatchError |
| class | Reader |
| Unserialize a JSON document into a Value. More... | |
| class | StaticString |
| Lightweight wrapper to tag static string. More... | |
| class | StyledStreamWriter |
| Writes a Value in JSON format in a human friendly way, to a stream rather than to a string. More... | |
| class | StyledWriter |
| Writes a Value in JSON format in a human friendly way. More... | |
| class | Value |
| Represents a JSON value. More... | |
| class | ValueAllocator |
| Experimental do not use: Allocator to customize member name and string value memory management done by Value. More... | |
| class | ValueConstIterator |
| const iterator for object and array value. More... | |
| class | ValueIterator |
| Iterator for object and array value. More... | |
| class | ValueIteratorBase |
| base class for Value iterators. More... | |
| class | Writer |
| Writer implements an O(1)-space, O(1)-granular output JSON writer. More... | |
| class | WriterBase |
| Abstract class for writers. More... | |
Typedefs | |
| using | Int = int |
| using | UInt = unsigned int |
| using | Output = std::function< void(boost::beast::string_view const &)> |
Enumerations | |
| enum | ValueType { nullValue = 0 , intValue , uintValue , realValue , stringValue , booleanValue , arrayValue , objectValue } |
| Type of the value held by a Value object. More... | |
Functions | |
| std::istream & | operator>> (std::istream &, Value &) |
| Read from 'sin' into 'root'. | |
| bool | operator== (StaticString x, StaticString y) |
| bool | operator!= (StaticString x, StaticString y) |
| bool | operator== (std::string const &x, StaticString y) |
| bool | operator!= (std::string const &x, StaticString y) |
| bool | operator== (StaticString x, std::string const &y) |
| bool | operator!= (StaticString x, std::string const &y) |
| Value | to_json (xrpl::Number const &number) |
| bool | operator== (Value const &, Value const &) |
| bool | operator!= (Value const &x, Value const &y) |
| bool | operator< (Value const &, Value const &) |
| bool | operator<= (Value const &x, Value const &y) |
| bool | operator> (Value const &x, Value const &y) |
| bool | operator>= (Value const &x, Value const &y) |
| std::string | valueToString (Int value) |
| std::string | valueToString (UInt value) |
| std::string | valueToString (double value) |
| std::string | valueToString (bool value) |
| std::string | valueToQuotedString (char const *value) |
| std::ostream & | operator<< (std::ostream &, Value const &root) |
| Output using the StyledStreamWriter. | |
| template<class Write > | |
| void | stream (Json::Value const &jv, Write const &write) |
| Stream compact JSON to the specified function. | |
| Output | stringOutput (std::string &s) |
| void | outputJson (Json::Value const &, Output const &) |
| Writes a minimal representation of a Json value to an Output in O(n) time. | |
| std::string | jsonAsString (Json::Value const &) |
| Return the minimal string representation of a Json::Value in O(n) time. | |
| std::string | to_string (Value const &) |
| Writes a Json::Value to an std::string. | |
| std::string | pretty (Value const &) |
| Writes a Json::Value to an std::string. | |
| void | check (bool condition, std::string const &message) |
| template<> | |
| xrpl::AccountID | getOrThrow (Json::Value const &v, xrpl::SField const &field) |
| template<class T > | |
| T | getOrThrow (Json::Value const &v, xrpl::SField const &field) |
| template<> | |
| std::string | getOrThrow (Json::Value const &v, xrpl::SField const &field) |
| template<> | |
| bool | getOrThrow (Json::Value const &v, xrpl::SField const &field) |
| template<> | |
| std::uint64_t | getOrThrow (Json::Value const &v, xrpl::SField const &field) |
| template<> | |
| xrpl::Buffer | getOrThrow (Json::Value const &v, xrpl::SField const &field) |
| template<class T > | |
| std::optional< T > | getOptional (Json::Value const &v, xrpl::SField const &field) |
| template<> | |
| xrpl::PublicKey | getOrThrow (Json::Value const &v, xrpl::SField const &field) |
| template<> | |
| xrpl::STAmount | getOrThrow (Json::Value const &v, xrpl::SField const &field) |
| static std::string | codePointToUTF8 (unsigned int cp) |
| static ValueAllocator *& | valueAllocator () |
| static int | integerCmp (Int i, UInt ui) |
| static bool | isControlCharacter (char ch) |
| static bool | containsControlCharacter (char const *str) |
| static void | uintToString (unsigned int value, char *¤t) |
Variables | |
| static struct Json::DummyValueAllocatorInitializer | dummyValueAllocatorInitializer |
JSON (JavaScript Object Notation).
| using Json::Int = typedef int |
Definition at line 7 of file json_forwards.h.
| using Json::UInt = typedef unsigned int |
Definition at line 8 of file json_forwards.h.
| using Json::Output = typedef std::function<void(boost::beast::string_view const&)> |
Definition at line 13 of file include/xrpl/json/Output.h.
| enum Json::ValueType |
Type of the value held by a Value object.
Definition at line 19 of file json_value.h.
| std::istream & Json::operator>> | ( | std::istream & | sin, |
| Value & | root | ||
| ) |
Read from 'sin' into 'root'.
Always keep comments from the input JSON.
This can be used to read a file into a particular sub-object. For example:
Result:
{
"dir": {
"file": {
// The input stream JSON would be nested here.
}
}
} | std::exception | on parse error. |
Definition at line 937 of file json_reader.cpp.
| bool Json::operator== | ( | StaticString | x, |
| StaticString | y | ||
| ) |
Definition at line 68 of file json_value.h.
| bool Json::operator!= | ( | StaticString | x, |
| StaticString | y | ||
| ) |
Definition at line 74 of file json_value.h.
| bool Json::operator== | ( | std::string const & | x, |
| StaticString | y | ||
| ) |
Definition at line 80 of file json_value.h.
| bool Json::operator!= | ( | std::string const & | x, |
| StaticString | y | ||
| ) |
Definition at line 86 of file json_value.h.
| bool Json::operator== | ( | StaticString | x, |
| std::string const & | y | ||
| ) |
Definition at line 92 of file json_value.h.
| bool Json::operator!= | ( | StaticString | x, |
| std::string const & | y | ||
| ) |
Definition at line 98 of file json_value.h.
| Value Json::to_json | ( | xrpl::Number const & | number | ) |
Definition at line 433 of file json_value.h.
Definition at line 416 of file json_value.cpp.
Definition at line 442 of file json_value.h.
Definition at line 364 of file json_value.cpp.
Definition at line 450 of file json_value.h.
Definition at line 457 of file json_value.h.
Definition at line 463 of file json_value.h.
| std::string Json::valueToString | ( | Int | value | ) |
Definition at line 47 of file json_writer.cpp.
| std::string Json::valueToString | ( | UInt | value | ) |
Definition at line 66 of file json_writer.cpp.
| std::string Json::valueToString | ( | double | value | ) |
Definition at line 76 of file json_writer.cpp.
| std::string Json::valueToString | ( | bool | value | ) |
Definition at line 95 of file json_writer.cpp.
| std::string Json::valueToQuotedString | ( | char const * | value | ) |
Definition at line 101 of file json_writer.cpp.
| std::ostream & Json::operator<< | ( | std::ostream & | sout, |
| Value const & | root | ||
| ) |
Output using the StyledStreamWriter.
Definition at line 709 of file json_writer.cpp.
| void Json::stream | ( | Json::Value const & | jv, |
| Write const & | write | ||
| ) |
Stream compact JSON to the specified function.
| jv | The Json::Value to write |
| write | Invocable with signature void(void const*, std::size_t) that is called when output should be written to the stream. |
Definition at line 282 of file json_writer.h.
| Output Json::stringOutput | ( | std::string & | s | ) |
Definition at line 16 of file include/xrpl/json/Output.h.
| void Json::outputJson | ( | Json::Value const & | value, |
| Output const & | out | ||
| ) |
Writes a minimal representation of a Json value to an Output in O(n) time.
Data is streamed right to the output, so only a marginal amount of memory is used. This can be very important for a very large Json::Value.
Definition at line 74 of file libxrpl/json/Output.cpp.
| std::string Json::jsonAsString | ( | Json::Value const & | value | ) |
Return the minimal string representation of a Json::Value in O(n) time.
This requires a memory allocation for the full size of the output. If possible, use outputJson().
Definition at line 81 of file libxrpl/json/Output.cpp.
| std::string Json::to_string | ( | Value const & | value | ) |
Writes a Json::Value to an std::string.
Definition at line 9 of file to_string.cpp.
| std::string Json::pretty | ( | Value const & | value | ) |
Writes a Json::Value to an std::string.
Definition at line 15 of file to_string.cpp.
| void Json::check | ( | bool | condition, |
| std::string const & | message | ||
| ) |
Definition at line 234 of file json/Writer.h.
| xrpl::AccountID Json::getOrThrow | ( | Json::Value const & | v, |
| xrpl::SField const & | field | ||
| ) |
Definition at line 112 of file AccountID.h.
| T Json::getOrThrow | ( | Json::Value const & | v, |
| xrpl::SField const & | field | ||
| ) |
Definition at line 56 of file json_get_or_throw.h.
| std::string Json::getOrThrow | ( | Json::Value const & | v, |
| xrpl::SField const & | field | ||
| ) |
Definition at line 63 of file json_get_or_throw.h.
| bool Json::getOrThrow | ( | Json::Value const & | v, |
| xrpl::SField const & | field | ||
| ) |
Definition at line 79 of file json_get_or_throw.h.
| std::uint64_t Json::getOrThrow | ( | Json::Value const & | v, |
| xrpl::SField const & | field | ||
| ) |
Definition at line 96 of file json_get_or_throw.h.
| xrpl::Buffer Json::getOrThrow | ( | Json::Value const & | v, |
| xrpl::SField const & | field | ||
| ) |
Definition at line 129 of file json_get_or_throw.h.
| std::optional< T > Json::getOptional | ( | Json::Value const & | v, |
| xrpl::SField const & | field | ||
| ) |
Definition at line 144 of file json_get_or_throw.h.
| xrpl::PublicKey Json::getOrThrow | ( | Json::Value const & | v, |
| xrpl::SField const & | field | ||
| ) |
Definition at line 270 of file PublicKey.h.
| xrpl::STAmount Json::getOrThrow | ( | Json::Value const & | v, |
| xrpl::SField const & | field | ||
| ) |
Definition at line 757 of file STAmount.h.
|
static |
Definition at line 19 of file json_reader.cpp.
|
static |
Definition at line 62 of file json_value.cpp.
Definition at line 354 of file json_value.cpp.
|
static |
Definition at line 18 of file json_writer.cpp.
|
static |
Definition at line 24 of file json_writer.cpp.
|
static |
Definition at line 35 of file json_writer.cpp.
|
static |