| 
    rippled
    
   | 
 
JSON (JavaScript Object Notation). More...
Namespaces | |
| namespace | detail | 
Classes | |
| class | Array | 
| Represents a JSON array being written to a Writer.  More... | |
| class | Collection | 
| 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 | 
| class | JsonObject_test | 
| struct | JsonTypeMismatchError | 
| class | Object | 
| Represents a JSON object being written to a Writer.  More... | |
| 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... | |
| class | WriterObject | 
| An Object that contains its own Writer.  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 (ripple::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.   | |
| Json::Value & | setArray (Json::Value &, Json::StaticString const &key) | 
| Add a new subarray at a named key in a Json object.   | |
| Array | setArray (Object &, Json::StaticString const &key) | 
| Add a new subarray at a named key in a Json object.   | |
| Json::Value & | addObject (Json::Value &, Json::StaticString const &key) | 
| Add a new subobject at a named key in a Json object.   | |
| Object | addObject (Object &, Json::StaticString const &key) | 
| Add a new subobject at a named key in a Json object.   | |
| Json::Value & | appendArray (Json::Value &) | 
| Append a new subarray to a Json array.   | |
| Array | appendArray (Array &) | 
| Append a new subarray to a Json array.   | |
| Json::Value & | appendObject (Json::Value &) | 
| Append a new subobject to a Json object.   | |
| Object | appendObject (Array &) | 
| Append a new subobject to a Json object.   | |
| void | copyFrom (Json::Value &to, Json::Value const &from) | 
| Copy all the keys and values from one object into another.   | |
| void | copyFrom (Object &to, Json::Value const &from) | 
| Copy all the keys and values from one object into another.   | |
| WriterObject | stringWriterObject (std::string &) | 
| 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<> | |
| ripple::AccountID | getOrThrow (Json::Value const &v, ripple::SField const &field) | 
| template<class T > | |
| T | getOrThrow (Json::Value const &v, ripple::SField const &field) | 
| template<> | |
| std::string | getOrThrow (Json::Value const &v, ripple::SField const &field) | 
| template<> | |
| bool | getOrThrow (Json::Value const &v, ripple::SField const &field) | 
| template<> | |
| std::uint64_t | getOrThrow (Json::Value const &v, ripple::SField const &field) | 
| template<> | |
| ripple::Buffer | getOrThrow (Json::Value const &v, ripple::SField const &field) | 
| template<class T > | |
| std::optional< T > | getOptional (Json::Value const &v, ripple::SField const &field) | 
| template<> | |
| ripple::PublicKey | getOrThrow (Json::Value const &v, ripple::SField const &field) | 
| template<> | |
| ripple::STAmount | getOrThrow (Json::Value const &v, ripple::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) | 
| BEAST_DEFINE_TESTSUITE (JsonObject, json, ripple) | |
Variables | |
| static struct Json::DummyValueAllocatorInitializer | dummyValueAllocatorInitializer | 
JSON (JavaScript Object Notation).
| using Json::Int = typedef int | 
Definition at line 26 of file json_forwards.h.
| using Json::UInt = typedef unsigned int | 
Definition at line 27 of file json_forwards.h.
| using Json::Output = typedef std::function<void(boost::beast::string_view const&)> | 
Definition at line 32 of file include/xrpl/json/Output.h.
| enum Json::ValueType | 
Type of the value held by a Value object.
Definition at line 37 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 956 of file json_reader.cpp.
| bool Json::operator== | ( | StaticString | x, | 
| StaticString | y | ||
| ) | 
Definition at line 86 of file json_value.h.
| bool Json::operator!= | ( | StaticString | x, | 
| StaticString | y | ||
| ) | 
Definition at line 92 of file json_value.h.
| bool Json::operator== | ( | std::string const & | x, | 
| StaticString | y | ||
| ) | 
Definition at line 98 of file json_value.h.
| bool Json::operator!= | ( | std::string const & | x, | 
| StaticString | y | ||
| ) | 
Definition at line 104 of file json_value.h.
| bool Json::operator== | ( | StaticString | x, | 
| std::string const & | y | ||
| ) | 
Definition at line 110 of file json_value.h.
| bool Json::operator!= | ( | StaticString | x, | 
| std::string const & | y | ||
| ) | 
Definition at line 116 of file json_value.h.
| Value Json::to_json | ( | ripple::Number const & | number | ) | 
Definition at line 444 of file json_value.h.
Definition at line 438 of file json_value.cpp.
Definition at line 453 of file json_value.h.
Definition at line 386 of file json_value.cpp.
Definition at line 461 of file json_value.h.
Definition at line 468 of file json_value.h.
Definition at line 474 of file json_value.h.
| std::string Json::valueToString | ( | Int | value | ) | 
Definition at line 66 of file json_writer.cpp.
| std::string Json::valueToString | ( | UInt | value | ) | 
Definition at line 85 of file json_writer.cpp.
| std::string Json::valueToString | ( | double | value | ) | 
Definition at line 95 of file json_writer.cpp.
| std::string Json::valueToString | ( | bool | value | ) | 
Definition at line 114 of file json_writer.cpp.
| std::string Json::valueToQuotedString | ( | char const * | value | ) | 
Definition at line 120 of file json_writer.cpp.
| std::ostream & Json::operator<< | ( | std::ostream & | sout, | 
| Value const & | root | ||
| ) | 
Output using the StyledStreamWriter.
Definition at line 728 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 301 of file json_writer.h.
| Json::Value & Json::setArray | ( | Json::Value & | json, | 
| Json::StaticString const & | key | ||
| ) | 
| Array Json::setArray | ( | Object & | json, | 
| Json::StaticString const & | key | ||
| ) | 
| Json::Value & Json::addObject | ( | Json::Value & | json, | 
| Json::StaticString const & | key | ||
| ) | 
| Object Json::addObject | ( | Object & | object, | 
| Json::StaticString const & | key | ||
| ) | 
| Json::Value & Json::appendArray | ( | Json::Value & | json | ) | 
| Json::Value & Json::appendObject | ( | Json::Value & | json | ) | 
| void Json::copyFrom | ( | Json::Value & | to, | 
| Json::Value const & | from | ||
| ) | 
Copy all the keys and values from one object into another.
Definition at line 232 of file Object.cpp.
| void Json::copyFrom | ( | Object & | to, | 
| Json::Value const & | from | ||
| ) | 
Copy all the keys and values from one object into another.
Definition at line 241 of file Object.cpp.
| WriterObject Json::stringWriterObject | ( | std::string & | s | ) | 
Definition at line 247 of file Object.cpp.
| Output Json::stringOutput | ( | std::string & | s | ) | 
Definition at line 35 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 93 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 100 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 28 of file to_string.cpp.
| std::string Json::pretty | ( | Value const & | value | ) | 
Writes a Json::Value to an std::string.
Definition at line 34 of file to_string.cpp.
| void Json::check | ( | bool | condition, | 
| std::string const & | message | ||
| ) | 
Definition at line 253 of file json/Writer.h.
| ripple::AccountID Json::getOrThrow | ( | Json::Value const & | v, | 
| ripple::SField const & | field | ||
| ) | 
Definition at line 131 of file AccountID.h.
| T Json::getOrThrow | ( | Json::Value const & | v, | 
| ripple::SField const & | field | ||
| ) | 
Definition at line 56 of file json_get_or_throw.h.
| std::string Json::getOrThrow | ( | Json::Value const & | v, | 
| ripple::SField const & | field | ||
| ) | 
Definition at line 63 of file json_get_or_throw.h.
| bool Json::getOrThrow | ( | Json::Value const & | v, | 
| ripple::SField const & | field | ||
| ) | 
Definition at line 79 of file json_get_or_throw.h.
| std::uint64_t Json::getOrThrow | ( | Json::Value const & | v, | 
| ripple::SField const & | field | ||
| ) | 
Definition at line 96 of file json_get_or_throw.h.
| ripple::Buffer Json::getOrThrow | ( | Json::Value const & | v, | 
| ripple::SField const & | field | ||
| ) | 
Definition at line 129 of file json_get_or_throw.h.
| std::optional< T > Json::getOptional | ( | Json::Value const & | v, | 
| ripple::SField const & | field | ||
| ) | 
Definition at line 144 of file json_get_or_throw.h.
| ripple::PublicKey Json::getOrThrow | ( | Json::Value const & | v, | 
| ripple::SField const & | field | ||
| ) | 
Definition at line 293 of file PublicKey.h.
| ripple::STAmount Json::getOrThrow | ( | Json::Value const & | v, | 
| ripple::SField const & | field | ||
| ) | 
Definition at line 718 of file STAmount.h.
      
  | 
  static | 
Definition at line 38 of file json_reader.cpp.
      
  | 
  static | 
Definition at line 84 of file json_value.cpp.
Definition at line 376 of file json_value.cpp.
      
  | 
  static | 
Definition at line 37 of file json_writer.cpp.
      
  | 
  static | 
Definition at line 43 of file json_writer.cpp.
      
  | 
  static | 
Definition at line 54 of file json_writer.cpp.
| Json::BEAST_DEFINE_TESTSUITE | ( | JsonObject | , | 
| json | , | ||
| ripple | |||
| ) | 
      
  | 
  static |