Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Json::Value Class Reference

Represents a JSON value. More...

#include <json.h>

Classes

struct  CommentInfo
 
class  CZString
 
union  ValueHolder
 

Public Types

typedef Json::ArrayIndex ArrayIndex
 
typedef ValueConstIterator const_iterator
 
typedef Json::Int Int
 
typedef Json::Int64 Int64
 
typedef ValueIterator iterator
 
typedef Json::LargestInt LargestInt
 
typedef Json::LargestUInt LargestUInt
 
typedef std::vector< std::stringMembers
 
typedef std::map< CZString, ValueObjectValues
 
typedef Json::UInt UInt
 
typedef Json::UInt64 UInt64
 

Public Member Functions

Valueappend (const Value &value)
 Append value to array at the end. More...
 
bool asBool () const
 
const char * asCString () const
 Embedded zeroes could cause you trouble! More...
 
double asDouble () const
 
float asFloat () const
 
Int asInt () const
 
Int64 asInt64 () const
 
LargestInt asLargestInt () const
 
LargestUInt asLargestUInt () const
 
std::string asString () const
 Embedded zeroes are possible. More...
 
UInt asUInt () const
 
UInt64 asUInt64 () const
 
iterator begin ()
 
const_iterator begin () const
 
void clear ()
 
int compare (const Value &other) const
 
Value const * demand (char const *begin, char const *end)
 
bool empty () const
 Return true if empty array, empty object, or null; otherwise, false. More...
 
iterator end ()
 
const_iterator end () const
 
Value const * find (char const *begin, char const *end) const
 
Value get (ArrayIndex index, const Value &defaultValue) const
 
Value get (const char *begin, const char *end, const Value &defaultValue) const
 
Value get (const char *key, const Value &defaultValue) const
 
Value get (const std::string &key, const Value &defaultValue) const
 
std::string getComment (CommentPlacement placement) const
 Include delimiters and embedded newlines. More...
 
Members getMemberNames () const
 Return a list of the member names. More...
 
size_t getOffsetLimit () const
 
size_t getOffsetStart () const
 
bool getString (char const **begin, char const **end) const
 
bool hasComment (CommentPlacement placement) const
 
bool isArray () const
 
bool isBool () const
 
bool isConvertibleTo (ValueType other) const
 
bool isDouble () const
 
bool isInt () const
 
bool isInt64 () const
 
bool isIntegral () const
 
bool isMember (const char *begin, const char *end) const
 Same as isMember(std::string const& key)const. More...
 
bool isMember (const char *key) const
 
bool isMember (const std::string &key) const
 
bool isNull () const
 
bool isNumeric () const
 
bool isObject () const
 
bool isString () const
 
bool isUInt () const
 
bool isUInt64 () const
 
bool isValidIndex (ArrayIndex index) const
 Return true if index < size(). More...
 
bool operator! () const
 Return isNull() More...
 
bool operator!= (const Value &other) const
 
bool operator< (const Value &other) const
 Compare payload only, not comments etc. More...
 
bool operator<= (const Value &other) const
 
Valueoperator= (Value other)
 
bool operator== (const Value &other) const
 
bool operator> (const Value &other) const
 
bool operator>= (const Value &other) const
 
Valueoperator[] (ArrayIndex index)
 
const Valueoperator[] (ArrayIndex index) const
 
Valueoperator[] (const char *key)
 
const Valueoperator[] (const char *key) const
 
Valueoperator[] (const StaticString &key)
 Access an object value by name, create a null member if it does not exist. More...
 
Valueoperator[] (const std::string &key)
 
const Valueoperator[] (const std::string &key) const
 
Valueoperator[] (int index)
 
const Valueoperator[] (int index) const
 
bool removeIndex (ArrayIndex i, Value *removed)
 Remove the indexed array element. More...
 
bool removeMember (const char *begin, const char *end, Value *removed)
 Same as removeMember(std::string const& key, Value* removed) More...
 
Value removeMember (const char *key)
 Remove and return the named member. More...
 
bool removeMember (const char *key, Value *removed)
 
Value removeMember (const std::string &key)
 
bool removeMember (std::string const &key, Value *removed)
 Remove the named map member. More...
 
void resize (ArrayIndex size)
 
void setComment (const char *comment, CommentPlacement placement)
 
void setComment (const char *comment, size_t len, CommentPlacement placement)
 Comments must be //... or /* ... *‍/. More...
 
void setComment (const std::string &comment, CommentPlacement placement)
 Comments must be //... or /* ... *‍/. More...
 
void setOffsetLimit (size_t limit)
 
void setOffsetStart (size_t start)
 
ArrayIndex size () const
 Number of values in array or object. More...
 
void swap (Value &other)
 Swap everything. More...
 
void swapPayload (Value &other)
 Swap values but leave comments and source offsets in place. More...
 
std::string toStyledString () const
 
ValueType type () const
 
 Value (bool value)
 
 Value (const char *begin, const char *end)
 Copy all, incl zeroes. More...
 
 Value (const char *value)
 Copy til first 0. (NULL causes to seg-fault.) More...
 
 Value (const StaticString &value)
 Constructs a value from a static string. More...
 
 Value (const std::string &value)
 Copy data() til size(). Embedded zeroes too. More...
 
 Value (const Value &other)
 Deep copy. More...
 
 Value (double value)
 
 Value (Int value)
 
 Value (Int64 value)
 
 Value (UInt value)
 
 Value (UInt64 value)
 
 Value (ValueType type=nullValue)
 Create a default Value of the given type. More...
 
 ~Value ()
 

Static Public Attributes

static const Int maxInt = Int(UInt(-1) / 2)
 Maximum signed int value that can be stored in a Json::Value. More...
 
static const Int64 maxInt64
 Maximum signed 64 bits int value that can be stored in a Json::Value. More...
 
static const LargestInt maxLargestInt = LargestInt(LargestUInt(-1) / 2)
 Maximum signed integer value that can be stored in a Json::Value. More...
 
static const LargestUInt maxLargestUInt = LargestUInt(-1)
 Maximum unsigned integer value that can be stored in a Json::Value. More...
 
static const UInt maxUInt = UInt(-1)
 Maximum unsigned int value that can be stored in a Json::Value. More...
 
static const UInt64 maxUInt64
 Maximum unsigned 64 bits int value that can be stored in a Json::Value. More...
 
static const Int minInt = Int(~(UInt(-1) / 2))
 Minimum signed int value that can be stored in a Json::Value. More...
 
static const Int64 minInt64
 Minimum signed 64 bits int value that can be stored in a Json::Value. More...
 
static const LargestInt minLargestInt = LargestInt(~(LargestUInt(-1) / 2))
 Minimum signed integer value that can be stored in a Json::Value. More...
 
static const Valuenull = reinterpret_cast<const Value&>(kNullRef)
 We regret this reference to a global instance; prefer the simpler Value(). More...
 
static const ValuenullRef = null
 

Private Member Functions

void initBasic (ValueType type, bool allocated=false)
 
ValueresolveReference (const char *key)
 
ValueresolveReference (const char *key, const char *end)
 

Private Attributes

unsigned int allocated_: 1
 
CommentInfocomments_
 
size_t limit_
 
size_t start_
 
ValueType type_: 8
 
union Json::Value::ValueHolder value_
 

Friends

class ValueIteratorBase
 

Detailed Description

Represents a JSON value.

This class is a discriminated union wrapper that can represents a:

The type of the held value is represented by a ValueType and can be obtained using type().

Values of an objectValue or arrayValue can be accessed using operator[]() methods. Non-const methods will automatically create the a nullValue element if it does not exist. The sequence of an arrayValue will be automatically resized and initialized with nullValue. resize() can be used to enlarge or truncate an arrayValue.

The get() methods can be used to obtain default value in the case the required element does not exist.

It is possible to iterate over the list of a objectValue values using the getMemberNames() method.

Note
Value string-length fit in size_t, but keys must be < 2^30. (The reason is an implementation detail.) A #CharReader will raise an exception if a bound is exceeded to avoid security holes in your app, but the Value API does not check bounds. That is the responsibility of the caller.

Definition at line 547 of file json.h.

Member Typedef Documentation

◆ ArrayIndex

typedef Json::ArrayIndex Json::Value::ArrayIndex

Definition at line 561 of file json.h.

◆ const_iterator

typedef ValueConstIterator Json::Value::const_iterator

Definition at line 552 of file json.h.

◆ Int

typedef Json::Int Json::Value::Int

Definition at line 554 of file json.h.

◆ Int64

typedef Json::Int64 Json::Value::Int64

Definition at line 557 of file json.h.

◆ iterator

typedef ValueIterator Json::Value::iterator

Definition at line 551 of file json.h.

◆ LargestInt

typedef Json::LargestInt Json::Value::LargestInt

Definition at line 559 of file json.h.

◆ LargestUInt

typedef Json::LargestUInt Json::Value::LargestUInt

Definition at line 560 of file json.h.

◆ Members

typedef std::vector<std::string> Json::Value::Members

Definition at line 550 of file json.h.

◆ ObjectValues

typedef std::map<CZString, Value> Json::Value::ObjectValues

Definition at line 630 of file json.h.

◆ UInt

typedef Json::UInt Json::Value::UInt

Definition at line 553 of file json.h.

◆ UInt64

typedef Json::UInt64 Json::Value::UInt64

Definition at line 556 of file json.h.

Constructor & Destructor Documentation

◆ Value() [1/12]

Value::Value ( ValueType  type = nullValue)

Create a default Value of the given type.

This is a very useful constructor. To create an empty array, pass arrayValue. To create an empty object, pass objectValue. Another Value can then be set to this one by assignment. This is useful since clear() and resize() will not alter types.

Examples:
Json::Value null_value; // null
Json::Value arr_value(Json::arrayValue); // []
Json::Value obj_value(Json::objectValue); // {}

Definition at line 2717 of file jsoncpp.cpp.

◆ Value() [2/12]

Value::Value ( Int  value)

Definition at line 2744 of file jsoncpp.cpp.

◆ Value() [3/12]

Value::Value ( UInt  value)

Definition at line 2749 of file jsoncpp.cpp.

◆ Value() [4/12]

Json::Value::Value ( Int64  value)

◆ Value() [5/12]

Json::Value::Value ( UInt64  value)

◆ Value() [6/12]

Value::Value ( double  value)

Definition at line 2764 of file jsoncpp.cpp.

◆ Value() [7/12]

Value::Value ( const char *  value)

Copy til first 0. (NULL causes to seg-fault.)

Definition at line 2769 of file jsoncpp.cpp.

◆ Value() [8/12]

Value::Value ( const char *  begin,
const char *  end 
)

Copy all, incl zeroes.

Definition at line 2774 of file jsoncpp.cpp.

◆ Value() [9/12]

Value::Value ( const StaticString value)

Constructs a value from a static string.

Like other value string constructor but do not duplicate the string for internal storage. The given string must remain alive after the call to this constructor.

Note
This works only for null-terminated strings. (We cannot change the size of this class, so we have nowhere to store the length, which might be computed later for various operations.)

Example of usage:

static StaticString foo("some text");
Json::Value aValue(foo);

Definition at line 2786 of file jsoncpp.cpp.

◆ Value() [10/12]

Value::Value ( const std::string value)

Copy data() til size(). Embedded zeroes too.

Definition at line 2780 of file jsoncpp.cpp.

◆ Value() [11/12]

Value::Value ( bool  value)

Definition at line 2798 of file jsoncpp.cpp.

◆ Value() [12/12]

Value::Value ( const Value other)

Deep copy.

Definition at line 2803 of file jsoncpp.cpp.

◆ ~Value()

Value::~Value ( )

Definition at line 2855 of file jsoncpp.cpp.

Member Function Documentation

◆ append()

Value & Value::append ( const Value value)

Append value to array at the end.

Equivalent to jsonvalue[jsonvalue.size()] = value;

Definition at line 3478 of file jsoncpp.cpp.

◆ asBool()

bool Value::asBool ( ) const

Definition at line 3212 of file jsoncpp.cpp.

◆ asCString()

const char * Value::asCString ( ) const

Embedded zeroes could cause you trouble!

Definition at line 3009 of file jsoncpp.cpp.

◆ asDouble()

double Value::asDouble ( ) const

Definition at line 3168 of file jsoncpp.cpp.

◆ asFloat()

float Value::asFloat ( ) const

Definition at line 3190 of file jsoncpp.cpp.

◆ asInt()

Value::Int Value::asInt ( ) const

Definition at line 3063 of file jsoncpp.cpp.

◆ asInt64()

Int64 Json::Value::asInt64 ( ) const

◆ asLargestInt()

LargestInt Value::asLargestInt ( ) const

Definition at line 3152 of file jsoncpp.cpp.

◆ asLargestUInt()

LargestUInt Value::asLargestUInt ( ) const

Definition at line 3160 of file jsoncpp.cpp.

◆ asString()

std::string Value::asString ( ) const

Embedded zeroes are possible.

Definition at line 3028 of file jsoncpp.cpp.

◆ asUInt()

Value::UInt Value::asUInt ( ) const

Definition at line 3085 of file jsoncpp.cpp.

◆ asUInt64()

UInt64 Json::Value::asUInt64 ( ) const

◆ begin() [1/2]

iterator Json::Value::begin ( )

◆ begin() [2/2]

Value::iterator Value::begin ( ) const

Definition at line 3762 of file jsoncpp.cpp.

◆ clear()

void Value::clear ( )

Remove all object members and array elements.

Precondition
type() is arrayValue, objectValue, or nullValue
Postcondition
type() is unchanged

Definition at line 3297 of file jsoncpp.cpp.

◆ compare()

int Value::compare ( const Value other) const

Definition at line 2903 of file jsoncpp.cpp.

◆ demand()

Value const* Json::Value::demand ( char const *  begin,
char const *  end 
)

Most general and efficient version of object-mutators.

Note
As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
Returns
non-zero, but JSON_ASSERT if this is neither object nor nullValue.

◆ empty()

bool Value::empty ( ) const

Return true if empty array, empty object, or null; otherwise, false.

Definition at line 3288 of file jsoncpp.cpp.

◆ end() [1/2]

iterator Json::Value::end ( )

◆ end() [2/2]

Value::iterator Value::end ( ) const

Definition at line 3775 of file jsoncpp.cpp.

◆ find()

Value const * Value::find ( char const *  begin,
char const *  end 
) const

Most general and efficient version of isMember()const, get()const, and operator[]const

Note
As stated elsewhere, behavior is undefined if (end-begin) >= 2^30

Definition at line 3430 of file jsoncpp.cpp.

◆ get() [1/4]

Value Value::get ( ArrayIndex  index,
const Value defaultValue 
) const

If the array contains at least index+1 elements, returns the element value, otherwise returns defaultValue.

Definition at line 3423 of file jsoncpp.cpp.

◆ get() [2/4]

Value Value::get ( const char *  begin,
const char *  end,
const Value defaultValue 
) const

Return the member named key if it exist, defaultValue otherwise.

Note
deep copy
key may contain embedded nulls.

Definition at line 3480 of file jsoncpp.cpp.

◆ get() [3/4]

Value Value::get ( const char *  key,
const Value defaultValue 
) const

Return the member named key if it exist, defaultValue otherwise.

Note
deep copy

Definition at line 3485 of file jsoncpp.cpp.

◆ get() [4/4]

Value Value::get ( const std::string key,
const Value defaultValue 
) const

Return the member named key if it exist, defaultValue otherwise.

Note
deep copy
Parameters
keymay contain embedded nulls.

Definition at line 3489 of file jsoncpp.cpp.

◆ getComment()

std::string Value::getComment ( CommentPlacement  placement) const

Include delimiters and embedded newlines.

Definition at line 3743 of file jsoncpp.cpp.

◆ getMemberNames()

Value::Members Value::getMemberNames ( ) const

Return a list of the member names.

If null, return an empty list.

Precondition
type() is objectValue or nullValue
Postcondition
if type() was nullValue, it remains nullValue

Definition at line 3582 of file jsoncpp.cpp.

◆ getOffsetLimit()

size_t Value::getOffsetLimit ( ) const

Definition at line 3755 of file jsoncpp.cpp.

◆ getOffsetStart()

size_t Value::getOffsetStart ( ) const

Definition at line 3753 of file jsoncpp.cpp.

◆ getString()

bool Value::getString ( char const **  begin,
char const **  end 
) const

Get raw char* of string-value.

Returns
false if !string. (Seg-fault if str or end are NULL.)

Definition at line 3019 of file jsoncpp.cpp.

◆ hasComment()

bool Value::hasComment ( CommentPlacement  placement) const

Definition at line 3739 of file jsoncpp.cpp.

◆ initBasic()

void Value::initBasic ( ValueType  type,
bool  allocated = false 
)
private

Definition at line 3374 of file jsoncpp.cpp.

◆ isArray()

bool Value::isArray ( ) const

Definition at line 3717 of file jsoncpp.cpp.

◆ isBool()

bool Value::isBool ( ) const

Definition at line 3631 of file jsoncpp.cpp.

◆ isConvertibleTo()

bool Value::isConvertibleTo ( ValueType  other) const

Definition at line 3231 of file jsoncpp.cpp.

◆ isDouble()

bool Value::isDouble ( ) const

Definition at line 3711 of file jsoncpp.cpp.

◆ isInt()

bool Value::isInt ( ) const

Definition at line 3633 of file jsoncpp.cpp.

◆ isInt64()

bool Value::isInt64 ( ) const

Definition at line 3663 of file jsoncpp.cpp.

◆ isIntegral()

bool Value::isIntegral ( ) const

Definition at line 3703 of file jsoncpp.cpp.

◆ isMember() [1/3]

bool Value::isMember ( const char *  begin,
const char *  end 
) const

Same as isMember(std::string const& key)const.

Definition at line 3562 of file jsoncpp.cpp.

◆ isMember() [2/3]

bool Value::isMember ( const char *  key) const

Return true if the object has a member named key.

Note
'key' must be null-terminated.

Definition at line 3567 of file jsoncpp.cpp.

◆ isMember() [3/3]

bool Value::isMember ( const std::string key) const

Return true if the object has a member named key.

Parameters
keymay contain embedded nulls.

Definition at line 3571 of file jsoncpp.cpp.

◆ isNull()

bool Value::isNull ( ) const

Definition at line 3629 of file jsoncpp.cpp.

◆ isNumeric()

bool Value::isNumeric ( ) const

Definition at line 3713 of file jsoncpp.cpp.

◆ isObject()

bool Value::isObject ( ) const

Definition at line 3719 of file jsoncpp.cpp.

◆ isString()

bool Value::isString ( ) const

Definition at line 3715 of file jsoncpp.cpp.

◆ isUInt()

bool Value::isUInt ( ) const

Definition at line 3648 of file jsoncpp.cpp.

◆ isUInt64()

bool Value::isUInt64 ( ) const

Definition at line 3683 of file jsoncpp.cpp.

◆ isValidIndex()

bool Value::isValidIndex ( ArrayIndex  index) const

Return true if index < size().

Definition at line 3428 of file jsoncpp.cpp.

◆ operator!()

bool Value::operator! ( ) const

Return isNull()

Definition at line 3295 of file jsoncpp.cpp.

◆ operator!=()

bool Value::operator!= ( const Value other) const

Definition at line 3007 of file jsoncpp.cpp.

◆ operator<()

bool Value::operator< ( const Value other) const

Compare payload only, not comments etc.

Definition at line 2911 of file jsoncpp.cpp.

◆ operator<=()

bool Value::operator<= ( const Value other) const

Definition at line 2957 of file jsoncpp.cpp.

◆ operator=()

Value & Value::operator= ( Value  other)

Deep copy, then swap(other).

Note
Over-write existing comments. To preserve comments, use swapPayload().

Definition at line 2879 of file jsoncpp.cpp.

◆ operator==()

bool Value::operator== ( const Value other) const

Definition at line 2963 of file jsoncpp.cpp.

◆ operator>()

bool Value::operator> ( const Value other) const

Definition at line 2961 of file jsoncpp.cpp.

◆ operator>=()

bool Value::operator>= ( const Value other) const

Definition at line 2959 of file jsoncpp.cpp.

◆ operator[]() [1/9]

Value & Value::operator[] ( ArrayIndex  index)

Access an array element (zero based index ). If the array contains less than index element, then null value are inserted in the array so that its size is index+1. (You may need to say 'value[0u]' to get your compiler to distinguish this from the operator[] which takes a string.)

Definition at line 3331 of file jsoncpp.cpp.

◆ operator[]() [2/9]

const Value & Value::operator[] ( ArrayIndex  index) const

Access an array element (zero based index ) (You may need to say 'value[0u]' to get your compiler to distinguish this from the operator[] which takes a string.)

Definition at line 3354 of file jsoncpp.cpp.

◆ operator[]() [3/9]

Value & Value::operator[] ( const char *  key)

Access an object value by name, create a null member if it does not exist.

Note
Because of our implementation, keys are limited to 2^30 -1 chars. Exceeding that will cause an exception.

Definition at line 3454 of file jsoncpp.cpp.

◆ operator[]() [4/9]

const Value & Value::operator[] ( const char *  key) const

Access an object value by name, returns null if there is no member with that name.

Definition at line 3441 of file jsoncpp.cpp.

◆ operator[]() [5/9]

Value & Value::operator[] ( const StaticString key)

Access an object value by name, create a null member if it does not exist.

If the object has no entry for that name, then the member name used to store the new entry is not duplicated. Example of use:

Json::Value object;
static const StaticString code("code");
object[code] = 1234;

Definition at line 3462 of file jsoncpp.cpp.

◆ operator[]() [6/9]

Value & Value::operator[] ( const std::string key)

Access an object value by name, create a null member if it does not exist.

Parameters
keymay contain embedded nulls.

Definition at line 3458 of file jsoncpp.cpp.

◆ operator[]() [7/9]

Value const & Value::operator[] ( const std::string key) const

Access an object value by name, returns null if there is no member with that name.

Parameters
keymay contain embedded nulls.

Definition at line 3447 of file jsoncpp.cpp.

◆ operator[]() [8/9]

Value & Value::operator[] ( int  index)

Access an array element (zero based index ). If the array contains less than index element, then null value are inserted in the array so that its size is index+1. (You may need to say 'value[0u]' to get your compiler to distinguish this from the operator[] which takes a string.)

Definition at line 3347 of file jsoncpp.cpp.

◆ operator[]() [9/9]

const Value & Value::operator[] ( int  index) const

Access an array element (zero based index ) (You may need to say 'value[0u]' to get your compiler to distinguish this from the operator[] which takes a string.)

Definition at line 3367 of file jsoncpp.cpp.

◆ removeIndex()

bool Value::removeIndex ( ArrayIndex  i,
Value removed 
)

Remove the indexed array element.

O(n) expensive operations. Update 'removed' iff removed.

Returns
true iff removed (no exceptions)

Definition at line 3532 of file jsoncpp.cpp.

◆ removeMember() [1/5]

bool Value::removeMember ( const char *  begin,
const char *  end,
Value removed 
)

◆ removeMember() [2/5]

Value Value::removeMember ( const char *  key)

Remove and return the named member.

Do nothing if it did not exist.

Returns
the removed Value, or null.
Precondition
type() is objectValue or nullValue
Postcondition
type() is unchanged
Deprecated:

Definition at line 3516 of file jsoncpp.cpp.

◆ removeMember() [3/5]

bool Value::removeMember ( const char *  key,
Value removed 
)

Same as removeMember(const char* begin, const char* end, Value* removed), but 'key' is null-terminated.

Definition at line 3508 of file jsoncpp.cpp.

◆ removeMember() [4/5]

Value Value::removeMember ( const std::string key)

Same as removeMember(const char*)

Parameters
keymay contain embedded nulls.
Deprecated:

Definition at line 3527 of file jsoncpp.cpp.

◆ removeMember() [5/5]

bool Value::removeMember ( std::string const &  key,
Value removed 
)

Remove the named map member.

Update 'removed' iff removed.

Parameters
keymay contain embedded nulls.
Returns
true iff removed (no exceptions)

Definition at line 3512 of file jsoncpp.cpp.

◆ resize()

void Value::resize ( ArrayIndex  size)

Resize the array to size elements. New elements are initialized to null. May only be called on nullValue or arrayValue.

Precondition
type() is arrayValue or nullValue
Postcondition
type() is arrayValue

Definition at line 3313 of file jsoncpp.cpp.

◆ resolveReference() [1/2]

Value & Value::resolveReference ( const char *  key)
private

Definition at line 3385 of file jsoncpp.cpp.

◆ resolveReference() [2/2]

Value & Value::resolveReference ( const char *  key,
const char *  end 
)
private

Definition at line 3404 of file jsoncpp.cpp.

◆ setComment() [1/3]

void Value::setComment ( const char *  comment,
CommentPlacement  placement 
)
Deprecated:
Always pass len.

Definition at line 3731 of file jsoncpp.cpp.

◆ setComment() [2/3]

void Value::setComment ( const char *  comment,
size_t  len,
CommentPlacement  placement 
)

Comments must be //... or /* ... *‍/.

Definition at line 3721 of file jsoncpp.cpp.

◆ setComment() [3/3]

void Value::setComment ( const std::string comment,
CommentPlacement  placement 
)

Comments must be //... or /* ... *‍/.

Definition at line 3735 of file jsoncpp.cpp.

◆ setOffsetLimit()

void Value::setOffsetLimit ( size_t  limit)

Definition at line 3751 of file jsoncpp.cpp.

◆ setOffsetStart()

void Value::setOffsetStart ( size_t  start)

Definition at line 3749 of file jsoncpp.cpp.

◆ size()

ArrayIndex Value::size ( ) const

Number of values in array or object.

Definition at line 3265 of file jsoncpp.cpp.

◆ swap()

void Value::swap ( Value other)

Swap everything.

Definition at line 2894 of file jsoncpp.cpp.

◆ swapPayload()

void Value::swapPayload ( Value other)

Swap values but leave comments and source offsets in place.

Definition at line 2884 of file jsoncpp.cpp.

◆ toStyledString()

std::string Value::toStyledString ( ) const

Definition at line 3757 of file jsoncpp.cpp.

◆ type()

ValueType Value::type ( ) const

Definition at line 2901 of file jsoncpp.cpp.

Friends And Related Function Documentation

◆ ValueIteratorBase

friend class ValueIteratorBase
friend

Definition at line 548 of file json.h.

Member Data Documentation

◆ allocated_

unsigned int Json::Value::allocated_
private

Definition at line 980 of file json.h.

◆ comments_

CommentInfo* Json::Value::comments_
private

Definition at line 982 of file json.h.

◆ limit_

size_t Json::Value::limit_
private

Definition at line 987 of file json.h.

◆ maxInt

const Int Value::maxInt = Int(UInt(-1) / 2)
static

Maximum signed int value that can be stored in a Json::Value.

Definition at line 575 of file json.h.

◆ maxInt64

const Int64 Json::Value::maxInt64
static

Maximum signed 64 bits int value that can be stored in a Json::Value.

Definition at line 583 of file json.h.

◆ maxLargestInt

const LargestInt Value::maxLargestInt = LargestInt(LargestUInt(-1) / 2)
static

Maximum signed integer value that can be stored in a Json::Value.

Definition at line 568 of file json.h.

◆ maxLargestUInt

const LargestUInt Value::maxLargestUInt = LargestUInt(-1)
static

Maximum unsigned integer value that can be stored in a Json::Value.

Definition at line 570 of file json.h.

◆ maxUInt

const UInt Value::maxUInt = UInt(-1)
static

Maximum unsigned int value that can be stored in a Json::Value.

Definition at line 577 of file json.h.

◆ maxUInt64

const UInt64 Json::Value::maxUInt64
static

Maximum unsigned 64 bits int value that can be stored in a Json::Value.

Definition at line 585 of file json.h.

◆ minInt

const Int Value::minInt = Int(~(UInt(-1) / 2))
static

Minimum signed int value that can be stored in a Json::Value.

Definition at line 573 of file json.h.

◆ minInt64

const Int64 Json::Value::minInt64
static

Minimum signed 64 bits int value that can be stored in a Json::Value.

Definition at line 581 of file json.h.

◆ minLargestInt

const LargestInt Value::minLargestInt = LargestInt(~(LargestUInt(-1) / 2))
static

Minimum signed integer value that can be stored in a Json::Value.

Definition at line 566 of file json.h.

◆ null

const Value & Value::null = reinterpret_cast<const Value&>(kNullRef)
static

We regret this reference to a global instance; prefer the simpler Value().

Definition at line 563 of file json.h.

◆ nullRef

const Value & Value::nullRef = null
static

just a kludge for binary-compatibility; same as null

Definition at line 564 of file json.h.

◆ start_

size_t Json::Value::start_
private

Definition at line 986 of file json.h.

◆ type_

ValueType Json::Value::type_
private

Definition at line 979 of file json.h.

◆ value_

union Json::Value::ValueHolder Json::Value::value_
private

The documentation for this class was generated from the following files:
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json.h:470
foo
Definition: googletest-output-test_.cc:534
foo
int foo
Definition: statusor_test.cc:66
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json.h:471
Json::Value
Represents a JSON value.
Definition: json.h:547


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:11