6 #if !defined(JSON_IS_AMALGAMATION) 10 #endif // if !defined(JSON_IS_AMALGAMATION) 17 #include <cpptl/conststring.h> 22 #define JSON_ASSERT_UNREACHABLE assert(false) 29 #if defined(__ARMEL__) 30 #define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment))) 32 #define ALIGNAS(byte_alignment) 42 static Value const nullStatic;
54 #if defined(JSON_HAS_INT64) 62 #endif // defined(JSON_HAS_INT64) 67 #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) 68 template <
typename T,
typename U>
69 static inline bool InRange(
double d, T min, U max) {
73 return d >= min && d <= max;
75 #else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) 76 static inline double integerToDouble(
Json::UInt64 value) {
77 return static_cast<double>(
Int64(value / 2)) * 2.0 + static_cast<double>(
Int64(value & 1));
80 template <
typename T>
static inline double integerToDouble(T value) {
81 return static_cast<double>(value);
84 template <
typename T,
typename U>
85 static inline bool InRange(
double d, T min, U max) {
86 return d >= integerToDouble(min) && d <= integerToDouble(max);
88 #endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) 102 if (length >= static_cast<size_t>(Value::maxInt))
103 length = Value::maxInt - 1;
105 char* newString =
static_cast<char*
>(malloc(length + 1));
106 if (newString == NULL) {
108 "in Json::Value::duplicateStringValue(): " 109 "Failed to allocate string value buffer");
111 memcpy(newString, value, length);
112 newString[length] = 0;
124 JSON_ASSERT_MESSAGE(length <= static_cast<unsigned>(Value::maxInt) -
sizeof(
unsigned) - 1U,
125 "in Json::Value::duplicateAndPrefixStringValue(): " 126 "length too big for prefixing");
127 unsigned actualLength = length +
static_cast<unsigned>(
sizeof(unsigned)) + 1U;
128 char* newString =
static_cast<char*
>(malloc(actualLength));
129 if (newString == 0) {
131 "in Json::Value::duplicateAndPrefixStringValue(): " 132 "Failed to allocate string value buffer");
134 *
reinterpret_cast<unsigned*
>(newString) = length;
135 memcpy(newString +
sizeof(
unsigned), value, length);
136 newString[actualLength - 1U] = 0;
140 bool isPrefixed,
char const* prefixed,
141 unsigned* length,
char const** value)
144 *length =
static_cast<unsigned>(strlen(prefixed));
147 *length = *
reinterpret_cast<unsigned const*
>(prefixed);
148 *value = prefixed +
sizeof(unsigned);
153 #if JSONCPP_USING_SECURE_MEMORY 156 char const* valueDecoded;
158 size_t const size =
sizeof(unsigned) + length + 1U;
159 memset(value, 0, size);
164 size_t size = (length==0) ? strlen(value) : length;
165 memset(value, 0, size);
168 #else // !JSONCPP_USING_SECURE_MEMORY 175 #endif // JSONCPP_USING_SECURE_MEMORY 186 #if !defined(JSON_IS_AMALGAMATION) 189 #endif // if !defined(JSON_IS_AMALGAMATION) 225 Value::CommentInfo::CommentInfo() : comment_(0)
228 Value::CommentInfo::~CommentInfo() {
233 void Value::CommentInfo::setComment(
const char* text,
size_t len) {
240 text[0] ==
'\0' || text[0] ==
'/',
241 "in Json::Value::setComment(): Comments must start with /");
257 Value::CZString::CZString(
ArrayIndex aindex) : cstr_(0), index_(aindex) {}
259 Value::CZString::CZString(
char const* str,
unsigned ulength, DuplicationPolicy allocate)
262 storage_.policy_ = allocate & 0x3;
263 storage_.length_ = ulength & 0x3FFFFFFF;
266 Value::CZString::CZString(
const CZString& other) {
267 cstr_ = (other.storage_.policy_ != noDuplication && other.cstr_ != 0
270 storage_.policy_ =
static_cast<unsigned>(other.cstr_
271 ? (
static_cast<DuplicationPolicy
>(other.storage_.policy_) == noDuplication
272 ? noDuplication : duplicate)
273 :
static_cast<DuplicationPolicy
>(other.storage_.policy_)) & 3U;
274 storage_.length_ = other.storage_.length_;
277 #if JSON_HAS_RVALUE_REFERENCES 278 Value::CZString::CZString(CZString&& other)
279 : cstr_(other.cstr_), index_(other.index_) {
280 other.cstr_ =
nullptr;
284 Value::CZString::~CZString() {
285 if (cstr_ && storage_.policy_ == duplicate) {
290 void Value::CZString::swap(CZString& other) {
291 std::swap(cstr_, other.cstr_);
292 std::swap(index_, other.index_);
295 Value::CZString& Value::CZString::operator=(CZString other) {
300 bool Value::CZString::operator<(
const CZString& other)
const {
301 if (!cstr_)
return index_ < other.index_;
304 unsigned this_len = this->storage_.length_;
305 unsigned other_len = other.storage_.length_;
306 unsigned min_len = std::min<unsigned>(this_len, other_len);
308 int comp = memcmp(this->cstr_, other.cstr_, min_len);
309 if (comp < 0)
return true;
310 if (comp > 0)
return false;
311 return (this_len < other_len);
315 if (!cstr_)
return index_ == other.index_;
318 unsigned this_len = this->storage_.length_;
319 unsigned other_len = other.storage_.length_;
320 if (this_len != other_len)
return false;
322 int comp = memcmp(this->cstr_, other.cstr_, this_len);
326 ArrayIndex Value::CZString::index()
const {
return index_; }
329 const char* Value::CZString::data()
const {
return cstr_; }
330 unsigned Value::CZString::length()
const {
return storage_.length_; }
331 bool Value::CZString::isStaticString()
const {
return storage_.policy_ == noDuplication; }
346 static char const emptyString[] =
"";
360 value_.string_ =
const_cast<char*
>(
static_cast<char const*
>(emptyString));
364 value_.map_ =
new ObjectValues();
367 value_.bool_ =
false;
381 value_.uint_ = value;
383 #if defined(JSON_HAS_INT64) 390 value_.uint_ = value;
392 #endif // defined(JSON_HAS_INT64) 396 value_.real_ = value;
419 value_.string_ =
const_cast<char*
>(value.
c_str());
422 #ifdef JSON_USE_CPPTL 431 value_.bool_ = value;
435 : type_(other.type_), allocated_(false)
437 comments_(0), start_(other.start_), limit_(other.limit_)
445 value_ = other.value_;
448 if (other.value_.string_ && other.allocated_) {
456 value_.string_ = other.value_.string_;
462 value_.map_ =
new ObjectValues(*other.value_.map_);
467 if (other.comments_) {
470 const CommentInfo& otherComment = other.comments_[comment];
471 if (otherComment.comment_)
472 comments_[comment].setComment(
473 otherComment.comment_, strlen(otherComment.comment_));
478 #if JSON_HAS_RVALUE_REFERENCES 520 std::swap(value_, other.value_);
521 int temp2 = allocated_;
522 allocated_ = other.allocated_;
523 other.allocated_ = temp2 & 0x1;
528 std::swap(comments_, other.comments_);
529 std::swap(start_, other.start_);
530 std::swap(limit_, other.limit_);
544 int typeDelta = type_ - other.type_;
546 return typeDelta < 0 ? true :
false;
551 return value_.int_ < other.value_.int_;
553 return value_.uint_ < other.value_.uint_;
555 return value_.real_ < other.value_.real_;
557 return value_.bool_ < other.value_.bool_;
560 if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
561 if (other.value_.string_)
return true;
566 char const* this_str;
567 char const* other_str;
570 unsigned min_len = std::min<unsigned>(this_len, other_len);
572 int comp = memcmp(this_str, other_str, min_len);
573 if (comp < 0)
return true;
574 if (comp > 0)
return false;
575 return (this_len < other_len);
579 int delta = int(value_.map_->size() - other.value_.map_->size());
582 return (*value_.map_) < (*other.value_.map_);
601 int temp = other.type_;
608 return value_.int_ == other.value_.int_;
610 return value_.uint_ == other.value_.uint_;
612 return value_.real_ == other.value_.real_;
614 return value_.bool_ == other.value_.bool_;
617 if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
618 return (value_.string_ == other.value_.string_);
622 char const* this_str;
623 char const* other_str;
626 if (this_len != other_len)
return false;
628 int comp = memcmp(this_str, other_str, this_len);
633 return value_.map_->size() == other.value_.map_->size() &&
634 (*value_.map_) == (*other.value_.map_);
645 "in Json::Value::asCString(): requires stringValue");
646 if (value_.string_ == 0)
return 0;
648 char const* this_str;
653 #if JSONCPP_USING_SECURE_MEMORY 654 unsigned Value::getCStringLength()
const {
656 "in Json::Value::asCString(): requires stringValue");
657 if (value_.string_ == 0)
return 0;
659 char const* this_str;
667 if (value_.string_ == 0)
return false;
670 *cend = *str + length;
680 if (value_.string_ == 0)
return "";
682 char const* this_str;
687 return value_.bool_ ?
"true" :
"false";
699 #ifdef JSON_USE_CPPTL 700 CppTL::ConstString Value::asConstString()
const {
705 return CppTL::ConstString(str, len);
713 return Int(value_.int_);
716 return Int(value_.uint_);
719 "double out of Int range");
720 return Int(value_.real_);
724 return value_.bool_ ? 1 : 0;
735 return UInt(value_.int_);
738 return UInt(value_.uint_);
741 "double out of UInt range");
742 return UInt(value_.real_);
746 return value_.bool_ ? 1 : 0;
753 #if defined(JSON_HAS_INT64) 758 return Int64(value_.int_);
761 return Int64(value_.uint_);
764 "double out of Int64 range");
765 return Int64(value_.real_);
769 return value_.bool_ ? 1 : 0;
780 return UInt64(value_.int_);
782 return UInt64(value_.uint_);
785 "double out of UInt64 range");
786 return UInt64(value_.real_);
790 return value_.bool_ ? 1 : 0;
796 #endif // if defined(JSON_HAS_INT64) 799 #if defined(JSON_NO_INT64) 807 #if defined(JSON_NO_INT64) 817 return static_cast<double>(value_.int_);
819 #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) 820 return static_cast<double>(value_.uint_);
821 #else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) 822 return integerToDouble(value_.uint_);
823 #endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) 829 return value_.bool_ ? 1.0 : 0.0;
839 return static_cast<float>(value_.int_);
841 #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) 842 return static_cast<float>(value_.uint_);
843 #else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) 845 return static_cast<float>(integerToDouble(value_.uint_));
846 #endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) 848 return static_cast<float>(value_.real_);
852 return value_.bool_ ? 1.0f : 0.0f;
866 return value_.int_ ? true :
false;
868 return value_.uint_ ? true :
false;
871 return (value_.real_ != 0.0) ? true :
false;
884 (type_ ==
arrayValue && value_.map_->size() == 0) ||
885 (type_ ==
objectValue && value_.map_->size() == 0) ||
922 if (!value_.map_->empty()) {
923 ObjectValues::const_iterator itLast = value_.map_->end();
925 return (*itLast).first.index() + 1;
947 "in Json::Value::clear(): requires complex value");
953 value_.map_->clear();
962 "in Json::Value::resize(): requires arrayValue");
968 else if (newSize > oldSize)
969 (*this)[newSize - 1];
971 for (
ArrayIndex index = newSize; index < oldSize; ++index) {
972 value_.map_->erase(index);
981 "in Json::Value::operator[](ArrayIndex): requires arrayValue");
985 ObjectValues::iterator it = value_.map_->lower_bound(key);
986 if (it != value_.map_->end() && (*it).first == key)
990 it = value_.map_->insert(it, defaultValue);
997 "in Json::Value::operator[](int index): index cannot be negative");
1004 "in Json::Value::operator[](ArrayIndex)const: requires arrayValue");
1007 CZString key(index);
1008 ObjectValues::const_iterator it = value_.map_->find(key);
1009 if (it == value_.map_->end())
1011 return (*it).second;
1017 "in Json::Value::operator[](int index) const: index cannot be negative");
1021 void Value::initBasic(
ValueType vtype,
bool allocated) {
1023 allocated_ = allocated;
1032 Value& Value::resolveReference(
const char* key) {
1035 "in Json::Value::resolveReference(): requires objectValue");
1039 key, static_cast<unsigned>(strlen(key)), CZString::noDuplication);
1040 ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
1041 if (it != value_.map_->end() && (*it).first == actualKey)
1042 return (*it).second;
1044 ObjectValues::value_type defaultValue(actualKey,
nullSingleton());
1045 it = value_.map_->insert(it, defaultValue);
1046 Value& value = (*it).second;
1051 Value& Value::resolveReference(
char const* key,
char const* cend)
1055 "in Json::Value::resolveReference(key, end): requires objectValue");
1059 key, static_cast<unsigned>(cend-key), CZString::duplicateOnCopy);
1060 ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
1061 if (it != value_.map_->end() && (*it).first == actualKey)
1062 return (*it).second;
1064 ObjectValues::value_type defaultValue(actualKey,
nullSingleton());
1065 it = value_.map_->insert(it, defaultValue);
1066 Value& value = (*it).second;
1071 const Value* value = &((*this)[index]);
1081 "in Json::Value::find(key, end, found): requires objectValue or nullValue");
1083 CZString actualKey(key, static_cast<unsigned>(cend-key), CZString::noDuplication);
1084 ObjectValues::const_iterator it = value_.map_->find(actualKey);
1085 if (it == value_.map_->end())
return NULL;
1086 return &(*it).second;
1090 Value const* found =
find(key, key + strlen(key));
1096 Value const* found =
find(key.data(), key.data() + key.length());
1102 return resolveReference(key, key + strlen(key));
1106 return resolveReference(key.data(), key.data() + key.length());
1110 return resolveReference(key.
c_str());
1113 #ifdef JSON_USE_CPPTL 1115 return resolveReference(key.c_str(), key.end_c_str());
1119 Value const* found =
find(key.c_str(), key.end_c_str());
1130 return !found ? defaultValue : *found;
1134 return get(key, key + strlen(key), defaultValue);
1138 return get(key.data(), key.data() + key.length(), defaultValue);
1147 CZString actualKey(key, static_cast<unsigned>(cend-key), CZString::noDuplication);
1148 ObjectValues::iterator it = value_.map_->find(actualKey);
1149 if (it == value_.map_->end())
1151 *removed = it->second;
1152 value_.map_->erase(it);
1161 return removeMember(key.data(), key.data() + key.length(), removed);
1166 "in Json::Value::removeMember(): requires objectValue");
1183 CZString key(index);
1184 ObjectValues::iterator it = value_.map_->find(key);
1185 if (it == value_.map_->end()) {
1188 *removed = it->second;
1191 for (
ArrayIndex i = index; i < (oldSize - 1); ++i){
1193 (*value_.map_)[keey] = (*
this)[i + 1];
1196 CZString keyLast(oldSize - 1);
1197 ObjectValues::iterator itLast = value_.map_->find(keyLast);
1198 value_.map_->erase(itLast);
1202 #ifdef JSON_USE_CPPTL 1204 const Value& defaultValue)
const {
1205 return get(key.c_str(), key.end_c_str(), defaultValue);
1212 return NULL != value;
1216 return isMember(key, key + strlen(key));
1220 return isMember(key.data(), key.data() + key.length());
1223 #ifdef JSON_USE_CPPTL 1225 return isMember(key.c_str(), key.end_c_str());
1232 "in Json::Value::getMemberNames(), value must be objectValue");
1236 members.reserve(value_.map_->size());
1237 ObjectValues::const_iterator it = value_.map_->begin();
1238 ObjectValues::const_iterator itEnd = value_.map_->end();
1239 for (; it != itEnd; ++it) {
1241 (*it).first.length()));
1272 double integral_part;
1273 return modf(d, &integral_part) == 0.0;
1283 #if defined(JSON_HAS_INT64) 1291 return value_.real_ >=
minInt && value_.real_ <=
maxInt &&
1302 #if defined(JSON_HAS_INT64) 1305 return value_.int_ >= 0;
1308 #if defined(JSON_HAS_INT64) 1309 return value_.uint_ <=
maxUInt;
1314 return value_.real_ >= 0 && value_.real_ <=
maxUInt &&
1323 #if defined(JSON_HAS_INT64) 1333 return value_.real_ >= double(
minInt64) &&
1338 #endif // JSON_HAS_INT64 1343 #if defined(JSON_HAS_INT64) 1346 return value_.int_ >= 0;
1353 return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble &&
1358 #endif // JSON_HAS_INT64 1368 #if defined(JSON_HAS_INT64) 1372 return value_.real_ >= double(
minInt64) && value_.real_ < maxUInt64AsDouble &&
IsIntegral(value_.real_);
1375 #endif // JSON_HAS_INT64 1395 if ((len > 0) && (comment[len-1] ==
'\n')) {
1399 comments_[placement].setComment(comment, len);
1403 setComment(comment, strlen(comment), placement);
1407 setComment(comment.c_str(), comment.length(), placement);
1411 return comments_ != 0 && comments_[placement].comment_ != 0;
1416 return comments_[placement].comment_;
1430 return writer.
write(*
this);
1464 return iterator(value_.map_->begin());
1477 return iterator(value_.map_->end());
1491 : key_(), index_(index), kind_(kindIndex) {}
1494 : key_(key), index_(), kind_(kindKey) {}
1497 : key_(key.c_str()), index_(), kind_(kindKey) {}
1518 void Path::makePath(
const JSONCPP_STRING& path,
const InArgs& in) {
1519 const char* current = path.c_str();
1520 const char* end = current + path.length();
1521 InArgs::const_iterator itInArg = in.begin();
1522 while (current != end) {
1523 if (*current ==
'[') {
1525 if (*current ==
'%')
1526 addPathInArg(path, in, itInArg, PathArgument::kindIndex);
1529 for (; current != end && *current >=
'0' && *current <=
'9'; ++current)
1530 index = index * 10 +
ArrayIndex(*current -
'0');
1531 args_.push_back(index);
1533 if (current == end || *++current !=
']')
1534 invalidPath(path,
int(current - path.c_str()));
1535 }
else if (*current ==
'%') {
1536 addPathInArg(path, in, itInArg, PathArgument::kindKey);
1538 }
else if (*current ==
'.' || *current ==
']') {
1541 const char* beginName = current;
1542 while (current != end && !strchr(
"[.", *current))
1551 InArgs::const_iterator& itInArg,
1552 PathArgument::Kind kind) {
1553 if (itInArg == in.end()) {
1555 }
else if ((*itInArg)->kind_ != kind) {
1558 args_.push_back(**itInArg++);
1567 const Value* node = &root;
1568 for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
1570 if (arg.kind_ == PathArgument::kindIndex) {
1575 node = &((*node)[arg.index_]);
1576 }
else if (arg.kind_ == PathArgument::kindKey) {
1581 node = &((*node)[arg.key_]);
1593 const Value* node = &root;
1594 for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
1596 if (arg.kind_ == PathArgument::kindIndex) {
1598 return defaultValue;
1599 node = &((*node)[arg.index_]);
1600 }
else if (arg.kind_ == PathArgument::kindKey) {
1602 return defaultValue;
1603 node = &((*node)[arg.key_]);
1605 return defaultValue;
1612 Value* node = &root;
1613 for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
1615 if (arg.kind_ == PathArgument::kindIndex) {
1619 node = &((*node)[arg.index_]);
1620 }
else if (arg.kind_ == PathArgument::kindKey) {
1624 node = &((*node)[arg.key_]);
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.
static bool IsIntegral(double d)
int compare(const Value &other) const
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
Value const * find(char const *begin, char const *end) const
Most general and efficient version of isMember()const, get()const, and operator[]const.
Value & make(Value &root) const
Creates the "path" to access the specified node and returns a reference on the node.
LargestUInt asLargestUInt() const
array value (ordered list)
#define JSON_ASSERT_MESSAGE(condition, message)
static Value const & nullSingleton()
Prefer this to null or nullRef.
Json::ArrayIndex ArrayIndex
bool empty() const
Return true if empty array, empty object, or null; otherwise, false.
Members getMemberNames() const
Return a list of the member names.
object value (collection of name/value pairs).
bool getString(char const **begin, char const **end) const
Get raw char* of string-value.
void swapPayload(Value &other)
Swap values but leave comments and source offsets in place.
RuntimeError(std::string const &msg)
bool removeIndex(ArrayIndex i, Value *removed)
Remove the indexed array element.
static const Int maxInt
Maximum signed int value that can be stored in a Json::Value.
ptrdiff_t getOffsetStart() const
static const Value & null
We regret this reference to a global instance; prefer the simpler Value().
Lightweight wrapper to tag static string.
Value removeMember(const char *key)
Remove and return the named member.
std::string toStyledString() const
#define JSON_ASSERT(condition)
It should not be possible for a maliciously designed file to cause an abort() or seg-fault, so these macros are used only for pre-condition violations and internal logic errors.
static const UInt maxUInt
Maximum unsigned int value that can be stored in a Json::Value.
static const Value & nullRef
just a kludge for binary-compatibility; same as null
Json::LargestUInt LargestUInt
LogicError(std::string const &msg)
Value & operator=(Value other)
Deep copy, then swap(other).
static void releaseStringValue(char *value, unsigned)
const iterator for object and array value.
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)
static bool InRange(double d, T min, U max)
static const LargestInt minLargestInt
Minimum signed integer value that can be stored in a Json::Value.
std::string getComment(CommentPlacement placement) const
Include delimiters and embedded newlines.
static void decodePrefixedString(bool isPrefixed, char const *prefixed, unsigned *length, char const **value)
Value & operator[](ArrayIndex index)
Access an array element (zero based index ).
ArrayIndex size() const
Number of values in array or object.
const char * asCString() const
Embedded zeroes could cause you trouble!
bool operator==(const Value &other) const
ValueConstIterator const_iterator
LargestInt asLargestInt() const
bool operator>(const Value &other) const
std::string valueToString(Int value)
bool isValidIndex(ArrayIndex index) const
Return true if index < size().
std::string asString() const
Embedded zeroes are possible.
bool operator>=(const Value &other) const
std::string write(const Value &root)
Serialize a Value in JSON format.
JSON (JavaScript Object Notation).
bool operator==(const SecureAllocator< T > &, const SecureAllocator< U > &)
#define JSON_FAIL_MESSAGE(message)
void swap(Value &other)
Swap everything.
Json::LargestInt LargestInt
static const double maxUInt64AsDouble
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
ptrdiff_t getOffsetLimit() const
const char * c_str() const
Value get(ArrayIndex index, const Value &defaultValue) const
If the array contains at least index+1 elements, returns the element value, otherwise returns default...
const_iterator begin() const
Exception(std::string const &msg)
Value & append(const Value &value)
Append value to array at the end.
static char * duplicateAndPrefixStringValue(const char *value, unsigned int length)
#define JSON_ASSERT_UNREACHABLE
void setOffsetStart(ptrdiff_t start)
static char * duplicateStringValue(const char *value, size_t length)
Duplicates the specified string value.
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.
Exceptions which the user cannot easily avoid.
bool hasComment(CommentPlacement placement) const
void resize(ArrayIndex size)
Resize the array to size elements.
void clear()
Remove all object members and array elements.
bool operator!=(const Value &other) const
Iterator for object and array value.
static void releasePrefixedStringValue(char *value)
Free the string duplicated by duplicateStringValue()/duplicateAndPrefixStringValue().
void setOffsetLimit(ptrdiff_t limit)
bool isMember(const char *key) const
Return true if the object has a member named key.
std::vector< std::string > Members
bool operator<=(const Value &other) const
bool operator!() const
Return isNull()
const Value & resolve(const Value &root) const
bool isConvertibleTo(ValueType other) const
bool operator<(const Value &other) const
Compare payload only, not comments etc.
char const * what() const
Base class for all exceptions we throw.
const_iterator end() const
static const LargestInt maxLargestInt
Maximum signed integer value that can be stored in a Json::Value.
static const LargestUInt maxLargestUInt
Maximum unsigned integer value that can be stored in a Json::Value.