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 #if defined(JSON_HAS_INT64)
50 #endif // defined(JSON_HAS_INT64)
55 #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
56 template <
typename T,
typename U>
57 static inline bool InRange(
double d, T min, U max) {
58 return d >= min && d <= max;
60 #else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
61 static inline double integerToDouble(
Json::UInt64 value) {
62 return static_cast<double>(
Int64(value / 2)) * 2.0 +
Int64(value & 1);
65 template <
typename T>
static inline double integerToDouble(T value) {
66 return static_cast<double>(value);
69 template <
typename T,
typename U>
70 static inline bool InRange(
double d, T min, U max) {
71 return d >= integerToDouble(min) && d <= integerToDouble(max);
73 #endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
86 if (length >= (
size_t)Value::maxInt)
87 length = Value::maxInt - 1;
89 char* newString =
static_cast<char*
>(malloc(length + 1));
90 if (newString == NULL) {
92 "in Json::Value::duplicateStringValue(): "
93 "Failed to allocate string value buffer");
95 memcpy(newString, value, length);
96 newString[length] = 0;
109 "in Json::Value::duplicateAndPrefixStringValue(): "
110 "length too big for prefixing");
111 unsigned actualLength = length +
sizeof(unsigned) + 1U;
112 char* newString =
static_cast<char*
>(malloc(actualLength));
113 if (newString == 0) {
115 "in Json::Value::duplicateAndPrefixStringValue(): "
116 "Failed to allocate string value buffer");
118 *
reinterpret_cast<unsigned*
>(newString) = length;
119 memcpy(newString +
sizeof(
unsigned), value, length);
120 newString[actualLength - 1U] = 0;
124 bool isPrefixed,
char const* prefixed,
125 unsigned* length,
char const** value)
128 *length = strlen(prefixed);
131 *length = *
reinterpret_cast<unsigned const*
>(prefixed);
132 *value = prefixed +
sizeof(unsigned);
148 #if !defined(JSON_IS_AMALGAMATION)
151 #endif // if !defined(JSON_IS_AMALGAMATION)
155 class JSON_API Exception :
public std::exception {
157 Exception(std::string
const& msg);
158 virtual ~Exception() throw();
159 virtual
char const* what() const throw();
161 std::
string const msg_;
163 class
JSON_API RuntimeError : public Exception {
165 RuntimeError(std::string
const& msg);
167 class JSON_API LogicError :
public Exception {
169 LogicError(std::string
const& msg);
172 Exception::Exception(std::string
const& msg)
175 Exception::~Exception() throw()
177 char const* Exception::what()
const throw()
181 RuntimeError::RuntimeError(std::string
const& msg)
184 LogicError::LogicError(std::string
const& msg)
189 throw RuntimeError(msg);
193 throw LogicError(msg);
204 Value::CommentInfo::CommentInfo() : comment_(0) {}
206 Value::CommentInfo::~CommentInfo() {
211 void Value::CommentInfo::setComment(
const char* text,
size_t len) {
218 text[0] ==
'\0' || text[0] ==
'/',
219 "in Json::Value::setComment(): Comments must start with /");
235 Value::CZString::CZString(
ArrayIndex index) : cstr_(0), index_(index) {}
237 Value::CZString::CZString(
char const* str,
unsigned length, DuplicationPolicy allocate)
241 storage_.policy_ = allocate;
242 storage_.length_ = length;
245 Value::CZString::CZString(
const CZString& other)
246 : cstr_(other.storage_.policy_ != noDuplication && other.cstr_ != 0
250 storage_.policy_ = (other.cstr_
251 ? (other.storage_.policy_ == noDuplication
252 ? noDuplication : duplicate)
253 : other.storage_.policy_);
254 storage_.length_ = other.storage_.length_;
257 Value::CZString::~CZString() {
258 if (cstr_ && storage_.policy_ == duplicate)
262 void Value::CZString::swap(CZString& other) {
263 std::swap(cstr_, other.cstr_);
264 std::swap(index_, other.index_);
267 Value::CZString& Value::CZString::operator=(CZString other) {
272 bool Value::CZString::operator<(
const CZString& other)
const {
273 if (!cstr_)
return index_ < other.index_;
276 unsigned this_len = this->storage_.length_;
277 unsigned other_len = other.storage_.length_;
278 unsigned min_len = std::min(this_len, other_len);
279 int comp = memcmp(this->cstr_, other.cstr_, min_len);
280 if (comp < 0)
return true;
281 if (comp > 0)
return false;
282 return (this_len < other_len);
285 bool Value::CZString::operator==(
const CZString& other)
const {
286 if (!cstr_)
return index_ == other.index_;
289 unsigned this_len = this->storage_.length_;
290 unsigned other_len = other.storage_.length_;
291 if (this_len != other_len)
return false;
292 int comp = memcmp(this->cstr_, other.cstr_, this_len);
296 ArrayIndex Value::CZString::index()
const {
return index_; }
299 const char* Value::CZString::data()
const {
return cstr_; }
300 unsigned Value::CZString::length()
const {
return storage_.length_; }
301 bool Value::CZString::isStaticString()
const {
return storage_.policy_ == noDuplication; }
332 value_.map_ =
new ObjectValues();
335 value_.bool_ =
false;
349 value_.uint_ = value;
351 #if defined(JSON_HAS_INT64)
358 value_.uint_ = value;
360 #endif // defined(JSON_HAS_INT64)
362 Value::Value(
double value) {
364 value_.real_ = value;
367 Value::Value(
const char* value) {
372 Value::Value(
const char* beginValue,
const char* endValue) {
378 Value::Value(
const std::string& value) {
386 value_.string_ =
const_cast<char*
>(value.
c_str());
389 #ifdef JSON_USE_CPPTL
390 Value::Value(
const CppTL::ConstString& value) {
396 Value::Value(
bool value) {
398 value_.bool_ = value;
402 : type_(other.type_), allocated_(false)
404 comments_(0), start_(other.start_), limit_(other.limit_)
412 value_ = other.value_;
415 if (other.value_.string_ && other.allocated_) {
423 value_.string_ = other.value_.string_;
429 value_.map_ =
new ObjectValues(*other.value_.map_);
434 if (other.comments_) {
437 const CommentInfo& otherComment = other.comments_[comment];
438 if (otherComment.comment_)
439 comments_[comment].setComment(
440 otherComment.comment_, strlen(otherComment.comment_));
478 std::swap(value_, other.value_);
479 int temp2 = allocated_;
480 allocated_ = other.allocated_;
481 other.allocated_ = temp2;
486 std::swap(comments_, other.comments_);
487 std::swap(start_, other.start_);
488 std::swap(limit_, other.limit_);
502 int typeDelta = type_ - other.type_;
504 return typeDelta < 0 ?
true :
false;
509 return value_.int_ < other.value_.int_;
511 return value_.uint_ < other.value_.uint_;
513 return value_.real_ < other.value_.real_;
515 return value_.bool_ < other.value_.bool_;
518 if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
519 if (other.value_.string_)
return true;
524 char const* this_str;
525 char const* other_str;
528 unsigned min_len = std::min(this_len, other_len);
529 int comp = memcmp(this_str, other_str, min_len);
530 if (comp < 0)
return true;
531 if (comp > 0)
return false;
532 return (this_len < other_len);
536 int delta = int(value_.map_->size() - other.value_.map_->size());
539 return (*value_.map_) < (*other.value_.map_);
558 int temp = other.type_;
565 return value_.int_ == other.value_.int_;
567 return value_.uint_ == other.value_.uint_;
569 return value_.real_ == other.value_.real_;
571 return value_.bool_ == other.value_.bool_;
574 if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
575 return (value_.string_ == other.value_.string_);
579 char const* this_str;
580 char const* other_str;
583 if (this_len != other_len)
return false;
584 int comp = memcmp(this_str, other_str, this_len);
589 return value_.map_->size() == other.value_.map_->size() &&
590 (*value_.map_) == (*other.value_.map_);
601 "in Json::Value::asCString(): requires stringValue");
602 if (value_.string_ == 0)
return 0;
604 char const* this_str;
611 if (value_.string_ == 0)
return false;
614 *end = *str + length;
624 if (value_.string_ == 0)
return "";
626 char const* this_str;
628 return std::string(this_str, this_len);
631 return value_.bool_ ?
"true" :
"false";
643 #ifdef JSON_USE_CPPTL
644 CppTL::ConstString Value::asConstString()
const {
649 return CppTL::ConstString(str, len);
657 return Int(value_.int_);
660 return Int(value_.uint_);
663 "double out of Int range");
664 return Int(value_.real_);
668 return value_.bool_ ? 1 : 0;
679 return UInt(value_.int_);
682 return UInt(value_.uint_);
685 "double out of UInt range");
686 return UInt(value_.real_);
690 return value_.bool_ ? 1 : 0;
697 #if defined(JSON_HAS_INT64)
702 return Int64(value_.int_);
705 return Int64(value_.uint_);
708 "double out of Int64 range");
709 return Int64(value_.real_);
713 return value_.bool_ ? 1 : 0;
724 return UInt64(value_.int_);
726 return UInt64(value_.uint_);
729 "double out of UInt64 range");
730 return UInt64(value_.real_);
734 return value_.bool_ ? 1 : 0;
740 #endif // if defined(JSON_HAS_INT64)
743 #if defined(JSON_NO_INT64)
751 #if defined(JSON_NO_INT64)
761 return static_cast<double>(value_.int_);
763 #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
764 return static_cast<double>(value_.uint_);
765 #else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
766 return integerToDouble(value_.uint_);
767 #endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
773 return value_.bool_ ? 1.0 : 0.0;
783 return static_cast<float>(value_.int_);
785 #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
786 return static_cast<float>(value_.uint_);
787 #else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
788 return integerToDouble(value_.uint_);
789 #endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
791 return static_cast<float>(value_.real_);
795 return value_.bool_ ? 1.0f : 0.0f;
809 return value_.int_ ?
true :
false;
811 return value_.uint_ ?
true :
false;
813 return value_.real_ ?
true :
false;
826 (type_ ==
arrayValue && value_.map_->size() == 0) ||
827 (type_ ==
objectValue && value_.map_->size() == 0) ||
864 if (!value_.map_->empty()) {
865 ObjectValues::const_iterator itLast = value_.map_->end();
867 return (*itLast).first.index() + 1;
889 "in Json::Value::clear(): requires complex value");
895 value_.map_->clear();
904 "in Json::Value::resize(): requires arrayValue");
910 else if (newSize > oldSize)
911 (*this)[newSize - 1];
913 for (
ArrayIndex index = newSize; index < oldSize; ++index) {
914 value_.map_->erase(index);
916 assert(
size() == newSize);
923 "in Json::Value::operator[](ArrayIndex): requires arrayValue");
927 ObjectValues::iterator it = value_.map_->lower_bound(key);
928 if (it != value_.map_->end() && (*it).first == key)
931 ObjectValues::value_type defaultValue(key,
nullRef);
932 it = value_.map_->insert(it, defaultValue);
939 "in Json::Value::operator[](int index): index cannot be negative");
946 "in Json::Value::operator[](ArrayIndex)const: requires arrayValue");
950 ObjectValues::const_iterator it = value_.map_->find(key);
951 if (it == value_.map_->end())
959 "in Json::Value::operator[](int index) const: index cannot be negative");
963 void Value::initBasic(
ValueType type,
bool allocated) {
965 allocated_ = allocated;
974 Value& Value::resolveReference(
const char* key) {
977 "in Json::Value::resolveReference(): requires objectValue");
981 key, static_cast<unsigned>(strlen(key)), CZString::noDuplication);
982 ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
983 if (it != value_.map_->end() && (*it).first == actualKey)
986 ObjectValues::value_type defaultValue(actualKey,
nullRef);
987 it = value_.map_->insert(it, defaultValue);
988 Value& value = (*it).second;
993 Value& Value::resolveReference(
char const* key,
char const* end)
997 "in Json::Value::resolveReference(key, end): requires objectValue");
1001 key, static_cast<unsigned>(end-key), CZString::duplicateOnCopy);
1002 ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
1003 if (it != value_.map_->end() && (*it).first == actualKey)
1004 return (*it).second;
1006 ObjectValues::value_type defaultValue(actualKey,
nullRef);
1007 it = value_.map_->insert(it, defaultValue);
1008 Value& value = (*it).second;
1013 const Value* value = &((*this)[index]);
1014 return value == &
nullRef ? defaultValue : *value;
1023 "in Json::Value::find(key, end, found): requires objectValue or nullValue");
1025 CZString actualKey(key, static_cast<unsigned>(end-key), CZString::noDuplication);
1026 ObjectValues::const_iterator it = value_.map_->find(actualKey);
1027 if (it == value_.map_->end())
return NULL;
1028 return &(*it).second;
1032 Value const* found =
find(key, key + strlen(key));
1038 Value const* found =
find(key.data(), key.data() + key.length());
1044 return resolveReference(key, key + strlen(key));
1048 return resolveReference(key.data(), key.data() + key.length());
1052 return resolveReference(key.
c_str());
1055 #ifdef JSON_USE_CPPTL
1057 return resolveReference(key.c_str(), key.end_c_str());
1061 Value const* found =
find(key.c_str(), key.end_c_str());
1072 return !found ? defaultValue : *found;
1076 return get(key, key + strlen(key), defaultValue);
1080 return get(key.data(), key.data() + key.length(), defaultValue);
1089 CZString actualKey(key, static_cast<unsigned>(end-key), CZString::noDuplication);
1090 ObjectValues::iterator it = value_.map_->find(actualKey);
1091 if (it == value_.map_->end())
1093 *removed = it->second;
1094 value_.map_->erase(it);
1103 return removeMember(key.data(), key.data() + key.length(), removed);
1108 "in Json::Value::removeMember(): requires objectValue");
1125 CZString key(index);
1126 ObjectValues::iterator it = value_.map_->find(key);
1127 if (it == value_.map_->end()) {
1130 *removed = it->second;
1133 for (
ArrayIndex i = index; i < (oldSize - 1); ++i){
1135 (*value_.map_)[key] = (*
this)[i + 1];
1138 CZString keyLast(oldSize - 1);
1139 ObjectValues::iterator itLast = value_.map_->find(keyLast);
1140 value_.map_->erase(itLast);
1144 #ifdef JSON_USE_CPPTL
1146 const Value& defaultValue)
const {
1147 return get(key.c_str(), key.end_c_str(), defaultValue);
1154 return NULL != value;
1158 return isMember(key, key + strlen(key));
1162 return isMember(key.data(), key.data() + key.length());
1165 #ifdef JSON_USE_CPPTL
1167 return isMember(key.c_str(), key.end_c_str());
1174 "in Json::Value::getMemberNames(), value must be objectValue");
1178 members.reserve(value_.map_->size());
1179 ObjectValues::const_iterator it = value_.map_->begin();
1180 ObjectValues::const_iterator itEnd = value_.map_->end();
1181 for (; it != itEnd; ++it) {
1182 members.push_back(std::string((*it).first.data(),
1183 (*it).first.length()));
1214 double integral_part;
1215 return modf(d, &integral_part) == 0.0;
1229 return value_.real_ >=
minInt && value_.real_ <=
maxInt &&
1242 return value_.uint_ <=
maxUInt;
1244 return value_.real_ >= 0 && value_.real_ <=
maxUInt &&
1253 #if defined(JSON_HAS_INT64)
1263 return value_.real_ >= double(
minInt64) &&
1268 #endif // JSON_HAS_INT64
1273 #if defined(JSON_HAS_INT64)
1276 return value_.int_ >= 0;
1283 return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble &&
1288 #endif // JSON_HAS_INT64
1293 #if defined(JSON_HAS_INT64)
1313 if ((len > 0) && (comment[len-1] ==
'\n')) {
1317 comments_[placement].setComment(comment, len);
1321 setComment(comment, strlen(comment), placement);
1325 setComment(comment.c_str(), comment.length(), placement);
1329 return comments_ != 0 && comments_[placement].comment_ != 0;
1334 return comments_[placement].comment_;
1348 return writer.
write(*
this);
1382 return iterator(value_.map_->begin());
1395 return iterator(value_.map_->end());
1409 : key_(), index_(index), kind_(kindIndex) {}
1412 : key_(key), index_(), kind_(kindKey) {}
1415 : key_(key.c_str()), index_(), kind_(kindKey) {}
1435 void Path::makePath(
const std::string& path,
const InArgs& in) {
1436 const char* current = path.c_str();
1437 const char* end = current + path.length();
1438 InArgs::const_iterator itInArg = in.begin();
1439 while (current != end) {
1440 if (*current ==
'[') {
1442 if (*current ==
'%')
1443 addPathInArg(path, in, itInArg, PathArgument::kindIndex);
1446 for (; current != end && *current >=
'0' && *current <=
'9'; ++current)
1447 index = index * 10 +
ArrayIndex(*current -
'0');
1448 args_.push_back(index);
1450 if (current == end || *current++ !=
']')
1451 invalidPath(path,
int(current - path.c_str()));
1452 }
else if (*current ==
'%') {
1453 addPathInArg(path, in, itInArg, PathArgument::kindKey);
1455 }
else if (*current ==
'.') {
1458 const char* beginName = current;
1459 while (current != end && !strchr(
"[.", *current))
1461 args_.push_back(std::string(beginName, current));
1466 void Path::addPathInArg(
const std::string& ,
1468 InArgs::const_iterator& itInArg,
1469 PathArgument::Kind kind) {
1470 if (itInArg == in.end()) {
1472 }
else if ((*itInArg)->kind_ != kind) {
1475 args_.push_back(**itInArg);
1479 void Path::invalidPath(
const std::string& ,
int ) {
1484 const Value* node = &root;
1485 for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
1487 if (arg.kind_ == PathArgument::kindIndex) {
1491 node = &((*node)[arg.index_]);
1492 }
else if (arg.kind_ == PathArgument::kindKey) {
1496 node = &((*node)[arg.key_]);
1497 if (node == &Value::nullRef) {
1507 const Value* node = &root;
1508 for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
1510 if (arg.kind_ == PathArgument::kindIndex) {
1512 return defaultValue;
1513 node = &((*node)[arg.index_]);
1514 }
else if (arg.kind_ == PathArgument::kindKey) {
1516 return defaultValue;
1517 node = &((*node)[arg.key_]);
1518 if (node == &Value::nullRef)
1519 return defaultValue;
1526 Value* node = &root;
1527 for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
1529 if (arg.kind_ == PathArgument::kindIndex) {
1533 node = &((*node)[arg.index_]);
1534 }
else if (arg.kind_ == PathArgument::kindKey) {
1538 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
Embedded zeroes are possible.
#define JSON_API
If defined, indicates that the source file is amalgated to prevent private header inclusion...
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
static const Value & null
We regret this reference to a global instance; prefer the simpler Value().
std::vector< std::string > Members
array value (ordered list)
LargestUInt asLargestUInt() const
bool getString(char const **str, char const **end) const
Get raw char* of string-value.
#define JSON_ASSERT_MESSAGE(condition, message)
#define ALIGNAS(byte_alignment)
void throwLogicError(std::string const &msg)
used internally
bool operator<(const Value &other) const
Compare payload only, not comments etc.
Json::ArrayIndex ArrayIndex
int compare(const Value &other) const
object value (collection of name/value pairs).
void swapPayload(Value &other)
Swap values but leave comments and source offsets in place.
void setOffsetStart(size_t start)
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.
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)
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.
Json::LargestUInt LargestUInt
Value & operator=(Value other)
Deep copy, then swap(other).
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)
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.
bool isMember(const char *key) const
Return true if the object has a member named key.
static void decodePrefixedString(bool isPrefixed, char const *prefixed, unsigned *length, char const **value)
static const unsigned char kNull[sizeof(Value)]
static const Value & nullRef
just a kludge for binary-compatibility; same as null
Value & operator[](ArrayIndex index)
Access an array element (zero based index ).
size_t getOffsetLimit() const
ValueConstIterator const_iterator
std::string valueToString(Int value)
virtual std::string write(const Value &root)
Serialize a Value in JSON format.
JSON (JavaScript Object Notation).
Members getMemberNames() const
Return a list of the member names.
Value const * find(char const *key, char const *end) const
Most general and efficient version of isMember()const, get()const, and operator[]const.
#define JSON_FAIL_MESSAGE(message)
void swap(Value &other)
Swap everything.
Json::LargestInt LargestInt
const char * c_str() const
static const double maxUInt64AsDouble
const char * asCString() const
Embedded zeroes could cause you trouble!
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
void throwRuntimeError(std::string const &msg)
used internally
bool operator>(const Value &other) const
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.
ArrayIndex size() const
Number of values in array or object.
std::string toStyledString() const
static char * duplicateAndPrefixStringValue(const char *value, unsigned int length)
#define JSON_ASSERT_UNREACHABLE
bool isConvertibleTo(ValueType other) const
static char * duplicateStringValue(const char *value, size_t length)
Duplicates the specified string value.
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
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
static void releaseStringValue(char *value)
Free the string duplicated by duplicateStringValue()/duplicateAndPrefixStringValue().
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.