20#ifndef RIPPLE_JSON_JSON_VALUE_H_INCLUDED
21#define RIPPLE_JSON_JSON_VALUE_H_INCLUDED
23#include <xrpl/json/json_forwards.h>
69 operator const char*()
const
218 Value(
const char* value);
302 operator bool()
const;
371 get(
const char* key,
const Value& defaultValue)
const;
641 explicit ValueIterator(
const Value::ObjectValues::iterator& current);
Lightweight wrapper to tag static string.
constexpr StaticString(const char *czstring)
constexpr const char * c_str() const
Experimental do not use: Allocator to customize member name and string value memory management done b...
virtual char * makeMemberName(const char *memberName)=0
virtual ~ValueAllocator()=default
virtual void releaseStringValue(char *value)=0
virtual void releaseMemberName(char *memberName)=0
virtual char * duplicateStringValue(const char *value, unsigned int length=unknown)=0
const iterator for object and array value.
ValueConstIterator SelfType
ValueConstIterator()=default
SelfType & operator=(const ValueIteratorBase &other)
reference operator*() const
base class for Value iterators.
bool isEqual(const SelfType &other) const
bool operator==(const SelfType &other) const
Value key() const
Return either the index or the member name of the referenced value as a Value.
void copy(const SelfType &other)
UInt index() const
Return the index of the referenced Value. -1 if it is not an arrayValue.
const char * memberName() const
Return the member name of the referenced Value.
bool operator!=(const SelfType &other) const
Value::ObjectValues::iterator current_
ValueIteratorBase SelfType
difference_type computeDistance(const SelfType &other) const
Iterator for object and array value.
reference operator*() const
SelfType & operator=(const SelfType &other)
bool isStaticString() const
const char * c_str() const
CZString & operator=(const CZString &other)=delete
const_iterator begin() const
friend bool operator==(const Value &, const Value &)
Value & resolveReference(const char *key, bool isStatic)
const char * asCString() const
Value get(UInt index, const Value &defaultValue) const
If the array contains at least index+1 elements, returns the element value, otherwise returns default...
UInt size() const
Number of values in array or object.
std::string toStyledString() const
const_iterator end() const
bool isObjectOrNull() const
void clear()
Remove all object members and array elements.
union Json::Value::ValueHolder value_
Members getMemberNames() const
Return a list of the member names.
Value & append(const Value &value)
Append value to array at the end.
Value & operator=(Value const &other)
friend bool operator<(const Value &, const Value &)
void swap(Value &other) noexcept
Swap values.
Value removeMember(const char *key)
Remove and return the named member.
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 isArrayOrNull() const
static const UInt maxUInt
bool isMember(const char *key) const
Return true if the object has a member named key.
bool isConvertibleTo(ValueType other) const
Value & operator[](UInt index)
Access an array element (zero based index ).
JSON (JavaScript Object Notation).
bool operator<(const Value &, const Value &)
bool operator>=(const Value &x, const Value &y)
bool operator!=(StaticString x, StaticString y)
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<=(const Value &x, const Value &y)
bool operator==(StaticString x, StaticString y)
bool operator>(const Value &x, const Value &y)