Home | History | Annotate | Download | only in json

Lines Matching refs:Value

28 bool JSONWriter::Write(const Value& node, std::string* json) {
33 bool JSONWriter::WriteWithOptions(const Value& node,
58 bool JSONWriter::BuildJSONString(const Value& node, size_t depth) {
60 case Value::TYPE_NULL: {
65 case Value::TYPE_BOOLEAN: {
66 bool value;
67 bool result = node.GetAsBoolean(&value);
69 json_string_->append(value ? "true" : "false");
73 case Value::TYPE_INTEGER: {
74 int value;
75 bool result = node.GetAsInteger(&value);
77 json_string_->append(IntToString(value));
81 case Value::TYPE_DOUBLE: {
82 double value;
83 bool result = node.GetAsDouble(&value);
86 value <= std::numeric_limits<int64_t>::max() &&
87 value >= std::numeric_limits<int64_t>::min() &&
88 std::floor(value) == value) {
89 json_string_->append(Int64ToString(static_cast<int64_t>(value)));
92 std::string real = DoubleToString(value);
113 case Value::TYPE_STRING: {
114 std::string value;
115 bool result = node.GetAsString(&value);
117 EscapeJSONString(value, true, json_string_);
121 case Value::TYPE_LIST: {
132 const Value* value = *it;
133 if (omit_binary_values_ && value->GetType() == Value::TYPE_BINARY)
142 if (!BuildJSONString(*value, depth))
154 case Value::TYPE_DICTIONARY: {
166 itr.value().GetType() == Value::TYPE_BINARY) {
184 if (!BuildJSONString(itr.value(), depth + 1U))
199 case Value::TYPE_BINARY:
201 DLOG_IF(ERROR, !omit_binary_values_) << "Cannot serialize binary value.";