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