|
rippled
|
JSON (JavaScript Object Notation). More...
Namespaces | |
| 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... | |
| class | JsonObject_test |
| class | JsonWriter_test |
| class | Object |
| Represents a JSON object being written to a Writer. More... | |
| struct | Output_test |
| 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 | |
| static std::string | codePointToUTF8 (unsigned int cp) |
| std::istream & | operator>> (std::istream &, Value &) |
| Read from 'sin' into 'root'. More... | |
| static ValueAllocator *& | valueAllocator () |
| static int | integerCmp (Int i, UInt ui) |
| bool | operator< (const Value &x, const Value &y) |
| bool | operator== (const Value &x, const Value &y) |
| static bool | isControlCharacter (char ch) |
| static bool | containsControlCharacter (const char *str) |
| static void | uintToString (unsigned int value, char *¤t) |
| std::string | valueToString (Int value) |
| std::string | valueToString (UInt value) |
| std::string | valueToString (double value) |
| std::string | valueToString (bool value) |
| std::string | valueToQuotedString (const char *value) |
| std::ostream & | operator<< (std::ostream &, const Value &root) |
| Output using the StyledStreamWriter. More... | |
| void | copyFrom (Json::Value &to, Json::Value const &from) |
| Copy all the keys and values from one object into another. More... | |
| void | copyFrom (Object &to, Json::Value const &from) |
| Copy all the keys and values from one object into another. More... | |
| WriterObject | stringWriterObject (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. More... | |
| std::string | jsonAsString (Json::Value const &) |
| Return the minimal string representation of a Json::Value in O(n) time. More... | |
| std::string | to_string (Value const &) |
| Writes a Json::Value to an std::string. More... | |
| std::string | pretty (Value const &) |
| Writes a Json::Value to an std::string. More... | |
| 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) |
| bool | operator!= (const Value &x, const Value &y) |
| bool | operator<= (const Value &x, const Value &y) |
| bool | operator> (const Value &x, const Value &y) |
| bool | operator>= (const Value &x, const Value &y) |
| template<class Write > | |
| void | stream (Json::Value const &jv, Write const &write) |
| Stream compact JSON to the specified function. More... | |
| Json::Value & | setArray (Json::Value &, Json::StaticString const &key) |
| Add a new subarray at a named key in a Json object. More... | |
| Array | setArray (Object &, Json::StaticString const &key) |
| Add a new subarray at a named key in a Json object. More... | |
| Json::Value & | addObject (Json::Value &, Json::StaticString const &key) |
| Add a new subobject at a named key in a Json object. More... | |
| Object | addObject (Object &, Json::StaticString const &key) |
| Add a new subobject at a named key in a Json object. More... | |
| Json::Value & | appendArray (Json::Value &) |
| Append a new subarray to a Json array. More... | |
| Array | appendArray (Array &) |
| Append a new subarray to a Json array. More... | |
| Json::Value & | appendObject (Json::Value &) |
| Append a new subobject to a Json object. More... | |
| Object | appendObject (Array &) |
| Append a new subobject to a Json object. More... | |
| Output | stringOutput (std::string &s) |
| void | check (bool condition, std::string const &message) |
| BEAST_DEFINE_TESTSUITE (JsonObject, ripple_basics, ripple) | |
| BEAST_DEFINE_TESTSUITE (Output, ripple_basics, ripple) | |
| BEAST_DEFINE_TESTSUITE (JsonWriter, ripple_basics, 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 30 of file json/Output.h.
| enum Json::ValueType |
Type of the value held by a Value object.
Definition at line 35 of file json_value.h.
|
static |
Definition at line 34 of file json_reader.cpp.
| std::istream & Json::operator>> | ( | std::istream & | , |
| Value & | |||
| ) |
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 953 of file json_reader.cpp.
|
static |
Definition at line 77 of file json_value.cpp.
Definition at line 356 of file json_value.cpp.
Definition at line 367 of file json_value.cpp.
Definition at line 416 of file json_value.cpp.
|
static |
Definition at line 30 of file json_writer.cpp.
|
static |
Definition at line 36 of file json_writer.cpp.
|
static |
Definition at line 47 of file json_writer.cpp.
| std::string Json::valueToString | ( | Int | value | ) |
Definition at line 59 of file json_writer.cpp.
| std::string Json::valueToString | ( | UInt | value | ) |
Definition at line 78 of file json_writer.cpp.
| std::string Json::valueToString | ( | double | value | ) |
Definition at line 88 of file json_writer.cpp.
| std::string Json::valueToString | ( | bool | value | ) |
Definition at line 107 of file json_writer.cpp.
| std::string Json::valueToQuotedString | ( | const char * | value | ) |
Definition at line 113 of file json_writer.cpp.
| std::ostream & Json::operator<< | ( | std::ostream & | , |
| const Value & | root | ||
| ) |
Output using the StyledStreamWriter.
Definition at line 714 of file json_writer.cpp.
| void Json::copyFrom | ( | Json::Value & | to, |
| Json::Value const & | from | ||
| ) |
Copy all the keys and values from one object into another.
Definition at line 226 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 235 of file Object.cpp.
| WriterObject Json::stringWriterObject | ( | std::string & | s | ) |
Definition at line 241 of file Object.cpp.
| void Json::outputJson | ( | Json::Value const & | , |
| Output const & | |||
| ) |
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 90 of file Output.cpp.
| std::string Json::jsonAsString | ( | Json::Value const & | ) |
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 97 of file Output.cpp.
| std::string Json::to_string | ( | Value const & | value | ) |
Writes a Json::Value to an std::string.
Definition at line 26 of file to_string.cpp.
| std::string Json::pretty | ( | Value const & | value | ) |
Writes a Json::Value to an std::string.
Definition at line 32 of file to_string.cpp.
| bool Json::operator== | ( | StaticString | x, |
| StaticString | y | ||
| ) |
Definition at line 83 of file json_value.h.
| bool Json::operator!= | ( | StaticString | x, |
| StaticString | y | ||
| ) |
Definition at line 89 of file json_value.h.
| bool Json::operator== | ( | std::string const & | x, |
| StaticString | y | ||
| ) |
Definition at line 95 of file json_value.h.
| bool Json::operator!= | ( | std::string const & | x, |
| StaticString | y | ||
| ) |
Definition at line 101 of file json_value.h.
| bool Json::operator== | ( | StaticString | x, |
| std::string const & | y | ||
| ) |
Definition at line 107 of file json_value.h.
| bool Json::operator!= | ( | StaticString | x, |
| std::string const & | y | ||
| ) |
Definition at line 113 of file json_value.h.
Definition at line 440 of file json_value.h.
Definition at line 449 of file json_value.h.
Definition at line 455 of file json_value.h.
Definition at line 461 of file json_value.h.
| 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 300 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 | ) |
| Output Json::stringOutput | ( | std::string & | s | ) |
Definition at line 33 of file json/Output.h.
| void Json::check | ( | bool | condition, |
| std::string const & | message | ||
| ) |
Definition at line 252 of file json/Writer.h.
| Json::BEAST_DEFINE_TESTSUITE | ( | JsonObject | , |
| ripple_basics | , | ||
| ripple | |||
| ) |
| Json::BEAST_DEFINE_TESTSUITE | ( | Output | , |
| ripple_basics | , | ||
| ripple | |||
| ) |
| Json::BEAST_DEFINE_TESTSUITE | ( | JsonWriter | , |
| ripple_basics | , | ||
| ripple | |||
| ) |
|
static |
1.8.17