Lines Matching refs:Value
9 #include <json/value.h>
90 Reader::parse(const std::string& document, Value& root, bool collectComments) {
97 bool Reader::parse(std::istream& sin, Value& root, bool collectComments) {
112 Value& root,
143 "A valid JSON document must be either an array or an object value.",
195 currentValue() = Value();
201 // "Un-read" the current token and mark the current value as a null
204 currentValue() = Value();
213 return addError("Syntax error: value, object or array expected.", token);
409 currentValue() = Value(objectValue);
424 Value numberName;
437 Value& value = currentValue()[name];
438 nodes_.push(&value);
462 currentValue() = Value(arrayValue);
473 Value& value = currentValue()[index++];
474 nodes_.push(&value);
499 Value decoded;
508 bool Reader::decodeNumber(Token& token, Value& decoded) {
517 // larger than the maximum supported value of an integer then
523 Value::LargestUInt maxIntegerValue =
524 isNegative ? Value::LargestUInt(-Value::minLargestInt)
525 : Value::maxLargestUInt;
526 Value::LargestUInt threshold = maxIntegerValue / 10;
527 Value::LargestUInt value = 0;
534 Value::UInt digit(c - '0');
535 if (value >= threshold) {
536 // We've hit or exceeded the max value divided by 10 (rounded down). If
540 if (value > threshold || current != token.end_ ||
545 value = value * 10 + digit;
548 decoded = -Value::LargestInt(value);
549 else if (value <= Value::LargestUInt(Value::maxInt))
550 decoded = Value::LargestInt(value);
552 decoded = value;
557 Value decoded;
566 bool Reader::decodeDouble(Token& token, Value& decoded) {
567 double value = 0;
588 count = sscanf(buffer, format, &value);
591 value);
598 decoded = value;
752 Value& Reader::currentValue() { return *(nodes_.top()); }
835 bool Reader::pushError(const Value& value, const std::string& message) {
837 if(value.getOffsetStart() > length
838 || value.getOffsetLimit() > length)
842 token.start_ = begin_ + value.getOffsetStart();
843 token.end_ = end_ + value.getOffsetLimit();
852 bool Reader::pushError(const Value& value, const std::string& message, const Value& extra) {
854 if(value.getOffsetStart() > length
855 || value.getOffsetLimit() > length
860 token.start_ = begin_ + value.getOffsetStart();
861 token.end_ = begin_ + value.getOffsetLimit();
874 std::istream& operator>>(std::istream& sin, Value& root) {