6 #if !defined(JSON_IS_AMALGAMATION)
10 #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
12 #endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
13 #endif // if !defined(JSON_IS_AMALGAMATION)
20 #include <cpptl/conststring.h>
24 #define JSON_ASSERT_UNREACHABLE assert(false)
31 #if defined(__ARMEL__)
32 #define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
34 #define ALIGNAS(byte_alignment)
43 #if defined(JSON_HAS_INT64)
51 #endif // defined(JSON_HAS_INT64)
57 static const unsigned int unknown = (unsigned)-1;
59 #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
60 template <
typename T,
typename U>
61 static inline bool InRange(
double d, T min, U max) {
62 return d >= min && d <= max;
64 #else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
65 static inline double integerToDouble(
Json::UInt64 value) {
66 return static_cast<double>(
Int64(value / 2)) * 2.0 +
Int64(value & 1);
69 template <
typename T>
static inline double integerToDouble(T value) {
70 return static_cast<double>(value);
73 template <
typename T,
typename U>
74 static inline bool InRange(
double d, T min, U max) {
75 return d >= integerToDouble(min) && d <= integerToDouble(max);
77 #endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
87 unsigned int length =
unknown) {
89 length = (
unsigned int)strlen(value);
96 char* newString =
static_cast<char*
>(malloc(length + 1));
98 "in Json::Value::duplicateStringValue(): "
99 "Failed to allocate string value buffer");
100 memcpy(newString, value, length);
101 newString[length] = 0;
118 #if !defined(JSON_IS_AMALGAMATION)
119 #ifdef JSON_VALUE_USE_INTERNAL_MAP
122 #endif // JSON_VALUE_USE_INTERNAL_MAP
125 #endif // if !defined(JSON_IS_AMALGAMATION)
137 Value::CommentInfo::CommentInfo() : comment_(0) {}
139 Value::CommentInfo::~CommentInfo() {
144 void Value::CommentInfo::setComment(
const char* text) {
149 text[0] ==
'\0' || text[0] ==
'/',
150 "in Json::Value::setComment(): Comments must start with /");
162 #ifndef JSON_VALUE_USE_INTERNAL_MAP
167 Value::CZString::CZString(
ArrayIndex index) : cstr_(0), index_(index) {}
169 Value::CZString::CZString(
const char* cstr, DuplicationPolicy allocate)
173 Value::CZString::CZString(
const CZString& other)
174 : cstr_(other.index_ != noDuplication && other.cstr_ != 0
178 ? (other.index_ == noDuplication ? noDuplication : duplicate)
181 Value::CZString::~CZString() {
182 if (cstr_ && index_ == duplicate)
186 void Value::CZString::swap(CZString& other) {
187 std::swap(cstr_, other.cstr_);
188 std::swap(index_, other.index_);
191 Value::CZString &Value::CZString::operator=(
const CZString &other) {
192 CZString temp(other);
197 bool Value::CZString::operator<(
const CZString& other)
const {
199 return strcmp(cstr_, other.cstr_) < 0;
200 return index_ < other.index_;
203 bool Value::CZString::operator==(
const CZString& other)
const {
205 return strcmp(cstr_, other.cstr_) == 0;
206 return index_ == other.index_;
209 ArrayIndex Value::CZString::index()
const {
return index_; }
211 const char* Value::CZString::c_str()
const {
return cstr_; }
213 bool Value::CZString::isStaticString()
const {
return index_ == noDuplication; }
215 #endif // ifndef JSON_VALUE_USE_INTERNAL_MAP
230 : type_(type), allocated_(false)
231 #ifdef JSON_VALUE_USE_INTERNAL_MAP
236 comments_(0), start_(0), limit_(0) {
250 #ifndef JSON_VALUE_USE_INTERNAL_MAP
253 value_.map_ =
new ObjectValues();
264 value_.bool_ =
false;
273 #ifdef JSON_VALUE_USE_INTERNAL_MAP
278 comments_(0), start_(0), limit_(0) {
279 value_.uint_ = value;
283 : type_(
intValue), allocated_(false)
284 #ifdef JSON_VALUE_USE_INTERNAL_MAP
289 comments_(0), start_(0), limit_(0) {
293 #if defined(JSON_HAS_INT64)
295 : type_(
intValue), allocated_(false)
296 #ifdef JSON_VALUE_USE_INTERNAL_MAP
301 comments_(0), start_(0), limit_(0) {
307 #ifdef JSON_VALUE_USE_INTERNAL_MAP
312 comments_(0), start_(0), limit_(0) {
313 value_.uint_ = value;
315 #endif // defined(JSON_HAS_INT64)
319 #ifdef JSON_VALUE_USE_INTERNAL_MAP
324 comments_(0), start_(0), limit_(0) {
325 value_.real_ = value;
330 #ifdef JSON_VALUE_USE_INTERNAL_MAP
335 comments_(0), start_(0), limit_(0) {
341 #ifdef JSON_VALUE_USE_INTERNAL_MAP
346 comments_(0), start_(0), limit_(0) {
353 #ifdef JSON_VALUE_USE_INTERNAL_MAP
358 comments_(0), start_(0), limit_(0) {
365 #ifdef JSON_VALUE_USE_INTERNAL_MAP
370 comments_(0), start_(0), limit_(0) {
371 value_.string_ =
const_cast<char*
>(value.
c_str());
374 #ifdef JSON_USE_CPPTL
377 #ifdef JSON_VALUE_USE_INTERNAL_MAP
382 comments_(0), start_(0), limit_(0) {
389 #ifdef JSON_VALUE_USE_INTERNAL_MAP
394 comments_(0), start_(0), limit_(0) {
395 value_.bool_ = value;
399 : type_(other.type_), allocated_(false)
400 #ifdef JSON_VALUE_USE_INTERNAL_MAP
405 comments_(0), start_(other.start_), limit_(other.limit_) {
412 value_ = other.value_;
415 if (other.value_.string_) {
423 #ifndef JSON_VALUE_USE_INTERNAL_MAP
426 value_.map_ =
new ObjectValues(*other.value_.map_);
439 if (other.comments_) {
442 const CommentInfo& otherComment = other.comments_[comment];
443 if (otherComment.comment_)
444 comments_[comment].setComment(otherComment.comment_);
461 #ifndef JSON_VALUE_USE_INTERNAL_MAP
492 std::swap(value_, other.value_);
493 int temp2 = allocated_;
494 allocated_ = other.allocated_;
495 other.allocated_ = temp2;
496 std::swap(start_, other.start_);
497 std::swap(limit_, other.limit_);
511 int typeDelta = type_ - other.type_;
513 return typeDelta < 0 ?
true :
false;
518 return value_.int_ < other.value_.int_;
520 return value_.uint_ < other.value_.uint_;
522 return value_.real_ < other.value_.real_;
524 return value_.bool_ < other.value_.bool_;
526 return (value_.string_ == 0 && other.value_.string_) ||
527 (other.value_.string_ && value_.string_ &&
528 strcmp(value_.string_, other.value_.string_) < 0);
529 #ifndef JSON_VALUE_USE_INTERNAL_MAP
532 int delta = int(value_.map_->size() - other.value_.map_->size());
535 return (*value_.map_) < (*other.value_.map_);
539 return value_.array_->compare(*(other.value_.array_)) < 0;
541 return value_.map_->compare(*(other.value_.map_)) < 0;
560 int temp = other.type_;
567 return value_.int_ == other.value_.int_;
569 return value_.uint_ == other.value_.uint_;
571 return value_.real_ == other.value_.real_;
573 return value_.bool_ == other.value_.bool_;
575 return (value_.string_ == other.value_.string_) ||
576 (other.value_.string_ && value_.string_ &&
577 strcmp(value_.string_, other.value_.string_) == 0);
578 #ifndef JSON_VALUE_USE_INTERNAL_MAP
581 return value_.map_->size() == other.value_.map_->size() &&
582 (*value_.map_) == (*other.value_.map_);
585 return value_.array_->compare(*(other.value_.array_)) == 0;
587 return value_.map_->compare(*(other.value_.map_)) == 0;
599 "in Json::Value::asCString(): requires stringValue");
600 return value_.string_;
608 return value_.string_ ? value_.string_ :
"";
610 return value_.bool_ ?
"true" :
"false";
622 #ifdef JSON_USE_CPPTL
623 CppTL::ConstString Value::asConstString()
const {
624 return CppTL::ConstString(
asString().c_str());
632 return Int(value_.int_);
635 return Int(value_.uint_);
638 "double out of Int range");
639 return Int(value_.real_);
643 return value_.bool_ ? 1 : 0;
654 return UInt(value_.int_);
657 return UInt(value_.uint_);
660 "double out of UInt range");
661 return UInt(value_.real_);
665 return value_.bool_ ? 1 : 0;
672 #if defined(JSON_HAS_INT64)
677 return Int64(value_.int_);
680 return Int64(value_.uint_);
683 "double out of Int64 range");
684 return Int64(value_.real_);
688 return value_.bool_ ? 1 : 0;
699 return UInt64(value_.int_);
701 return UInt64(value_.uint_);
704 "double out of UInt64 range");
705 return UInt64(value_.real_);
709 return value_.bool_ ? 1 : 0;
715 #endif // if defined(JSON_HAS_INT64)
718 #if defined(JSON_NO_INT64)
726 #if defined(JSON_NO_INT64)
736 return static_cast<double>(value_.int_);
738 #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
739 return static_cast<double>(value_.uint_);
740 #else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
741 return integerToDouble(value_.uint_);
742 #endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
748 return value_.bool_ ? 1.0 : 0.0;
758 return static_cast<float>(value_.int_);
760 #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
761 return static_cast<float>(value_.uint_);
762 #else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
763 return integerToDouble(value_.uint_);
764 #endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
766 return static_cast<float>(value_.real_);
770 return value_.bool_ ? 1.0f : 0.0f;
784 return value_.int_ ?
true :
false;
786 return value_.uint_ ?
true :
false;
788 return value_.real_ ?
true :
false;
801 (type_ ==
arrayValue && value_.map_->size() == 0) ||
802 (type_ ==
objectValue && value_.map_->size() == 0) ||
838 #ifndef JSON_VALUE_USE_INTERNAL_MAP
840 if (!value_.map_->empty()) {
841 ObjectValues::const_iterator itLast = value_.map_->end();
843 return (*itLast).first.index() + 1;
850 return Int(value_.array_->size());
852 return Int(value_.map_->size());
871 "in Json::Value::clear(): requires complex value");
875 #ifndef JSON_VALUE_USE_INTERNAL_MAP
878 value_.map_->clear();
882 value_.array_->clear();
885 value_.map_->clear();
895 "in Json::Value::resize(): requires arrayValue");
898 #ifndef JSON_VALUE_USE_INTERNAL_MAP
902 else if (newSize > oldSize)
903 (*this)[newSize - 1];
905 for (
ArrayIndex index = newSize; index < oldSize; ++index) {
906 value_.map_->erase(index);
908 assert(
size() == newSize);
911 value_.array_->resize(newSize);
918 "in Json::Value::operator[](ArrayIndex): requires arrayValue");
921 #ifndef JSON_VALUE_USE_INTERNAL_MAP
923 ObjectValues::iterator it = value_.map_->lower_bound(key);
924 if (it != value_.map_->end() && (*it).first == key)
927 ObjectValues::value_type defaultValue(key,
null);
928 it = value_.map_->insert(it, defaultValue);
931 return value_.array_->resolveReference(index);
938 "in Json::Value::operator[](int index): index cannot be negative");
945 "in Json::Value::operator[](ArrayIndex)const: requires arrayValue");
948 #ifndef JSON_VALUE_USE_INTERNAL_MAP
950 ObjectValues::const_iterator it = value_.map_->find(key);
951 if (it == value_.map_->end())
955 Value* value = value_.array_->find(index);
956 return value ? *value :
null;
963 "in Json::Value::operator[](int index) const: index cannot be negative");
968 return resolveReference(key,
false);
971 Value& Value::resolveReference(
const char* key,
bool isStatic) {
974 "in Json::Value::resolveReference(): requires objectValue");
977 #ifndef JSON_VALUE_USE_INTERNAL_MAP
979 key, isStatic ? CZString::noDuplication : CZString::duplicateOnCopy);
980 ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
981 if (it != value_.map_->end() && (*it).first == actualKey)
984 ObjectValues::value_type defaultValue(actualKey,
null);
985 it = value_.map_->insert(it, defaultValue);
986 Value& value = (*it).second;
989 return value_.map_->resolveReference(key, isStatic);
994 const Value* value = &((*this)[index]);
995 return value == &
null ? defaultValue : *value;
1003 "in Json::Value::operator[](char const*)const: requires objectValue");
1006 #ifndef JSON_VALUE_USE_INTERNAL_MAP
1007 CZString actualKey(key, CZString::noDuplication);
1008 ObjectValues::const_iterator it = value_.map_->find(actualKey);
1009 if (it == value_.map_->end())
1011 return (*it).second;
1013 const Value* value = value_.map_->find(key);
1014 return value ? *value :
null;
1019 return (*
this)[key.c_str()];
1023 return (*
this)[key.c_str()];
1027 return resolveReference(key,
true);
1030 #ifdef JSON_USE_CPPTL
1032 return (*
this)[key.c_str()];
1036 return (*
this)[key.c_str()];
1043 const Value* value = &((*this)[key]);
1044 return value == &
null ? defaultValue : *value;
1048 return get(key.c_str(), defaultValue);
1053 "in Json::Value::removeMember(): requires objectValue");
1056 #ifndef JSON_VALUE_USE_INTERNAL_MAP
1057 CZString actualKey(key, CZString::noDuplication);
1058 ObjectValues::iterator it = value_.map_->find(actualKey);
1059 if (it == value_.map_->end())
1061 Value old(it->second);
1062 value_.map_->erase(it);
1065 Value* value = value_.map_->find(key);
1068 value_.map_.remove(key);
1080 #ifdef JSON_USE_CPPTL
1082 const Value& defaultValue)
const {
1083 return get(key.c_str(), defaultValue);
1088 const Value* value = &((*this)[key]);
1089 return value != &
null;
1096 #ifdef JSON_USE_CPPTL
1105 "in Json::Value::getMemberNames(), value must be objectValue");
1109 members.reserve(value_.map_->size());
1110 #ifndef JSON_VALUE_USE_INTERNAL_MAP
1111 ObjectValues::const_iterator it = value_.map_->begin();
1112 ObjectValues::const_iterator itEnd = value_.map_->end();
1113 for (; it != itEnd; ++it)
1114 members.push_back(std::string((*it).first.c_str()));
1116 ValueInternalMap::IteratorState it;
1117 ValueInternalMap::IteratorState itEnd;
1118 value_.map_->makeBeginIterator(it);
1119 value_.map_->makeEndIterator(itEnd);
1120 for (; !ValueInternalMap::equals(it, itEnd); ValueInternalMap::increment(it))
1121 members.push_back(std::string(ValueInternalMap::key(it)));
1152 double integral_part;
1153 return modf(d, &integral_part) == 0.0;
1167 return value_.real_ >=
minInt && value_.real_ <=
maxInt &&
1180 return value_.uint_ <=
maxUInt;
1182 return value_.real_ >= 0 && value_.real_ <=
maxUInt &&
1191 #if defined(JSON_HAS_INT64)
1201 return value_.real_ >= double(
minInt64) &&
1206 #endif // JSON_HAS_INT64
1211 #if defined(JSON_HAS_INT64)
1214 return value_.int_ >= 0;
1226 #endif // JSON_HAS_INT64
1231 #if defined(JSON_HAS_INT64)
1251 comments_[placement].setComment(comment);
1259 return comments_ != 0 && comments_[placement].comment_ != 0;
1264 return comments_[placement].comment_;
1278 return writer.
write(*
this);
1283 #ifdef JSON_VALUE_USE_INTERNAL_MAP
1285 if (value_.array_) {
1286 ValueInternalArray::IteratorState it;
1287 value_.array_->makeBeginIterator(it);
1293 ValueInternalMap::IteratorState it;
1294 value_.map_->makeBeginIterator(it);
1313 #ifdef JSON_VALUE_USE_INTERNAL_MAP
1315 if (value_.array_) {
1316 ValueInternalArray::IteratorState it;
1317 value_.array_->makeEndIterator(it);
1323 ValueInternalMap::IteratorState it;
1324 value_.map_->makeEndIterator(it);
1343 #ifdef JSON_VALUE_USE_INTERNAL_MAP
1345 if (value_.array_) {
1346 ValueInternalArray::IteratorState it;
1347 value_.array_->makeBeginIterator(it);
1353 ValueInternalMap::IteratorState it;
1354 value_.map_->makeBeginIterator(it);
1362 return iterator(value_.map_->begin());
1373 #ifdef JSON_VALUE_USE_INTERNAL_MAP
1375 if (value_.array_) {
1376 ValueInternalArray::IteratorState it;
1377 value_.array_->makeEndIterator(it);
1383 ValueInternalMap::IteratorState it;
1384 value_.map_->makeEndIterator(it);
1392 return iterator(value_.map_->end());
1407 : key_(), index_(index), kind_(kindIndex) {}
1410 : key_(key), index_(), kind_(kindKey) {}
1413 : key_(key.c_str()), index_(), kind_(kindKey) {}
1433 void Path::makePath(
const std::string& path,
const InArgs&
in) {
1434 const char* current = path.c_str();
1435 const char* end = current + path.length();
1436 InArgs::const_iterator itInArg = in.begin();
1437 while (current != end) {
1438 if (*current ==
'[') {
1440 if (*current ==
'%')
1441 addPathInArg(path, in, itInArg, PathArgument::kindIndex);
1444 for (; current != end && *current >=
'0' && *current <=
'9'; ++current)
1445 index = index * 10 +
ArrayIndex(*current -
'0');
1446 args_.push_back(index);
1448 if (current == end || *current++ !=
']')
1449 invalidPath(path,
int(current - path.c_str()));
1450 }
else if (*current ==
'%') {
1451 addPathInArg(path, in, itInArg, PathArgument::kindKey);
1453 }
else if (*current ==
'.') {
1456 const char* beginName = current;
1457 while (current != end && !strchr(
"[.", *current))
1459 args_.push_back(std::string(beginName, current));
1464 void Path::addPathInArg(
const std::string& ,
1466 InArgs::const_iterator& itInArg,
1467 PathArgument::Kind kind) {
1468 if (itInArg == in.end()) {
1470 }
else if ((*itInArg)->kind_ != kind) {
1473 args_.push_back(**itInArg);
1477 void Path::invalidPath(
const std::string& ,
int ) {
1482 const Value* node = &root;
1483 for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
1485 if (arg.kind_ == PathArgument::kindIndex) {
1489 node = &((*node)[arg.index_]);
1490 }
else if (arg.kind_ == PathArgument::kindKey) {
1494 node = &((*node)[arg.key_]);
1505 const Value* node = &root;
1506 for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
1508 if (arg.kind_ == PathArgument::kindIndex) {
1510 return defaultValue;
1511 node = &((*node)[arg.index_]);
1512 }
else if (arg.kind_ == PathArgument::kindKey) {
1514 return defaultValue;
1515 node = &((*node)[arg.key_]);
1517 return defaultValue;
1524 Value* node = &root;
1525 for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
1527 if (arg.kind_ == PathArgument::kindIndex) {
1531 node = &((*node)[arg.index_]);
1532 }
else if (arg.kind_ == PathArgument::kindKey) {
1536 node = &((*node)[arg.key_]);
const unsigned char & kNullRef
bool hasComment(CommentPlacement placement) const
Path(const std::string &path, const PathArgument &a1=PathArgument(), const PathArgument &a2=PathArgument(), const PathArgument &a3=PathArgument(), const PathArgument &a4=PathArgument(), const PathArgument &a5=PathArgument())
Writes a Value in JSON format in a human friendly way.
Value & make(Value &root) const
Creates the "path" to access the specified node and returns a reference on the node.
static bool IsIntegral(double d)
std::string asString() const
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
static const Value & null
std::vector< std::string > Members
array value (ordered list)
static char * duplicateStringValue(const char *value, unsigned int length=unknown)
Duplicates the specified string value.
LargestUInt asLargestUInt() const
#define JSON_ASSERT_MESSAGE(condition, message)
#define ALIGNAS(byte_alignment)
bool operator<(const Value &other) const
Json::ArrayIndex ArrayIndex
int compare(const Value &other) const
object value (collection of name/value pairs).
void setOffsetStart(size_t start)
static const Int maxInt
Maximum signed int value that can be stored in a Json::Value.
bool empty() const
Return true if empty array, empty object, or null; otherwise, false.
Lightweight wrapper to tag static string.
Value removeMember(const char *key)
Remove and return the named member.
#define JSON_ASSERT(condition)
static const UInt maxUInt
Maximum unsigned int value that can be stored in a Json::Value.
Json::LargestUInt LargestUInt
static ValueArrayAllocator *& arrayAllocator()
virtual ValueInternalMap * newMap()=0
const iterator for object and array value.
virtual void destructArray(ValueInternalArray *array)=0
Value(ValueType type=nullValue)
Create a default Value of the given type.
Experimental and untested: represents an element of the "path" to access a node.
void setComment(const char *comment, CommentPlacement placement)
Comments must be //... or /* ... */.
static bool InRange(double d, T min, U max)
std::string getComment(CommentPlacement placement) const
Include delimiters and embedded newlines.
static const LargestInt minLargestInt
Minimum signed integer value that can be stored in a Json::Value.
virtual ValueInternalArray * newArray()=0
bool isMember(const char *key) const
Return true if the object has a member named key.
virtual ValueInternalArray * newArrayCopy(const ValueInternalArray &other)=0
static const unsigned char kNull[sizeof(Value)]
Value & operator[](ArrayIndex index)
Access an array element (zero based index ).
size_t getOffsetLimit() const
ValueConstIterator const_iterator
std::string valueToString(Int value)
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)
virtual std::string write(const Value &root)
Serialize a Value in JSON format.
Members getMemberNames() const
Return a list of the member names.
#define JSON_FAIL_MESSAGE(message)
void swap(Value &other)
Swap values.
Json::LargestInt LargestInt
const char * c_str() const
static const double maxUInt64AsDouble
const char * asCString() const
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
static const unsigned int unknown
Unknown size marker.
bool operator>(const Value &other) const
static ValueMapAllocator *& mapAllocator()
bool operator>=(const Value &other) const
bool operator==(const Value &other) const
const Value & resolve(const Value &root) const
bool isValidIndex(ArrayIndex index) const
Return true if index < size().
Value & append(const Value &value)
Append value to array at the end.
Value & operator=(const Value &other)
ArrayIndex size() const
Number of values in array or object.
std::string toStyledString() const
#define JSON_ASSERT_UNREACHABLE
bool isConvertibleTo(ValueType other) const
void setOffsetLimit(size_t limit)
static const Int64 minInt64
Minimum signed 64 bits int value that can be stored in a Json::Value.
static const Int minInt
Minimum signed int value that can be stored in a Json::Value.
bool operator!() const
Return isNull()
LargestInt asLargestInt() const
virtual ValueInternalMap * newMapCopy(const ValueInternalMap &other)=0
void resize(ArrayIndex size)
Resize the array to size elements.
void clear()
Remove all object members and array elements.
Iterator for object and array value.
bool operator<=(const Value &other) const
virtual void destructMap(ValueInternalMap *map)=0
static void releaseStringValue(char *value)
Free the string duplicated by duplicateStringValue().
ValueType
Type of the value held by a Value object.
Value get(ArrayIndex index, const Value &defaultValue) const
If the array contains at least index+1 elements, returns the element value, otherwise returns default...
size_t getOffsetStart() const
const_iterator begin() const
bool operator!=(const Value &other) const
static const LargestInt maxLargestInt
Maximum signed integer value that can be stored in a Json::Value.
const_iterator end() const
static const LargestUInt maxLargestUInt
Maximum unsigned integer value that can be stored in a Json::Value.