20#ifndef RIPPLE_JSON_JSON_VALUE_H_INCLUDED
21#define RIPPLE_JSON_JSON_VALUE_H_INCLUDED
23#include <xrpl/basics/Number.h>
24#include <xrpl/json/json_forwards.h>
70 operator char const*()
const
219 Value(
char const* value);
304 operator bool()
const;
375 get(
char const* key,
Value const& defaultValue)
const;
651 explicit ValueIterator(Value::ObjectValues::iterator
const& current);
Lightweight wrapper to tag static string.
constexpr char const * c_str() const
constexpr StaticString(char const *czstring)
Experimental do not use: Allocator to customize member name and string value memory management done b...
virtual char * makeMemberName(char const *memberName)=0
virtual ~ValueAllocator()=default
virtual void releaseStringValue(char *value)=0
virtual char * duplicateStringValue(char const *value, unsigned int length=unknown)=0
virtual void releaseMemberName(char *memberName)=0
const iterator for object and array value.
SelfType & operator=(ValueIteratorBase const &other)
ValueConstIterator SelfType
ValueConstIterator()=default
reference operator*() const
base class for Value iterators.
void copy(SelfType const &other)
Value key() const
Return either the index or the member name of the referenced value as a Value.
bool isEqual(SelfType const &other) const
char const * memberName() const
Return the member name of the referenced Value.
UInt index() const
Return the index of the referenced Value. -1 if it is not an arrayValue.
bool operator!=(SelfType const &other) const
difference_type computeDistance(SelfType const &other) const
Value::ObjectValues::iterator current_
ValueIteratorBase SelfType
bool operator==(SelfType const &other) const
Iterator for object and array value.
SelfType & operator=(SelfType const &other)
reference operator*() const
bool isStaticString() const
CZString & operator=(CZString const &other)=delete
char const * c_str() const
const_iterator begin() const
Value & append(Value const &value)
Append value to array at the end.
UInt size() const
Number of values in array or object.
std::string toStyledString() const
const_iterator end() const
bool isObjectOrNull() const
static UInt const maxUInt
void clear()
Remove all object members and array elements.
char const * asCString() const
union Json::Value::ValueHolder value_
friend bool operator==(Value const &, Value const &)
Members getMemberNames() const
Return a list of the member names.
Value & operator=(Value const &other)
Value removeMember(char const *key)
Remove and return the named member.
void swap(Value &other) noexcept
Swap values.
bool isValidIndex(UInt index) const
Return true if index < size().
std::string asString() const
Returns the unquoted string value.
bool isNull() const
isNull() tests to see if this field is null.
bool isMember(char const *key) const
Return true if the object has a member named key.
bool isArrayOrNull() const
Value get(UInt index, Value const &defaultValue) const
If the array contains at least index+1 elements, returns the element value, otherwise returns default...
friend bool operator<(Value const &, Value const &)
Value & resolveReference(char const *key, bool isStatic)
bool isConvertibleTo(ValueType other) const
Value & operator[](UInt index)
Access an array element (zero based index ).
JSON (JavaScript Object Notation).
bool operator<=(Value const &x, Value const &y)
bool operator>(Value const &x, Value const &y)
std::string to_string(Value const &)
Writes a Json::Value to an std::string.
bool operator!=(StaticString x, StaticString y)
Value to_json(ripple::Number const &number)
ValueType
Type of the value held by a Value object.
@ stringValue
UTF-8 string value.
@ arrayValue
array value (ordered list)
@ intValue
signed integer value
@ objectValue
object value (collection of name/value pairs).
@ uintValue
unsigned integer value
bool operator<(Value const &, Value const &)
bool operator==(StaticString x, StaticString y)
bool operator>=(Value const &x, Value const &y)