Home | History | Annotate | Download | only in base

Lines Matching refs:Value

24 scoped_ptr<Value> CopyWithoutEmptyChildren(const Value& node);
32 scoped_ptr<Value> child_copy = CopyWithoutEmptyChildren(**it);
46 scoped_ptr<Value> child_copy = CopyWithoutEmptyChildren(it.value());
56 scoped_ptr<Value> CopyWithoutEmptyChildren(const Value& node) {
58 case Value::TYPE_LIST:
61 case Value::TYPE_DICTIONARY:
73 // Pass the value against which all consecutive calls of the () operator will
74 // compare their argument to. This Value object must not be destroyed while
76 explicit ValueEquals(const Value* first) : first_(first) { }
78 bool operator ()(const Value* second) const {
83 const Value* first_;
88 Value::~Value() {
92 scoped_ptr<Value> Value::CreateNullValue() {
93 return make_scoped_ptr(new Value(TYPE_NULL));
96 bool Value::GetAsBinary(const BinaryValue** /* out_value */) const {
100 bool Value::GetAsBoolean(bool* /* out_value */) const {
104 bool Value::GetAsInteger(int* /* out_value */) const {
108 bool Value::GetAsDouble(double* /* out_value */) const {
112 bool Value::GetAsString(std::string* /* out_value */) const {
116 bool Value::GetAsString(const StringValue** out_value) const {
120 bool Value::GetAsList(ListValue** /* out_value */) {
124 bool Value::GetAsList(const ListValue** /* out_value */) const {
128 bool Value::GetAsDictionary(DictionaryValue** /* out_value */) {
132 bool Value::GetAsDictionary(const DictionaryValue** /* out_value */) const {
136 Value* Value::DeepCopy() const {
143 scoped_ptr<Value> Value::CreateDeepCopy() const {
147 bool Value::Equals(const Value* other) const {
155 bool Value::Equals(const Value* a, const Value* b) {
161 Value::Value(Type type) : type_(type) {}
163 Value::Value(const Value& that) : type_(that.type_) {}
165 Value& Value::operator=(const Value& that) {
173 : Value(TYPE_BOOLEAN), boolean_value_(in_value) {
177 : Value(TYPE_INTEGER), integer_value_(in_value) {
181 : Value(TYPE_DOUBLE), double_value_(in_value) {
229 bool FundamentalValue::Equals(const Value* other) const {
255 : Value(TYPE_STRING),
287 bool StringValue::Equals(const Value* other) const {
297 : Value(TYPE_BINARY),
302 : Value(TYPE_BINARY), buffer_(std::move(buffer)), size_(size) {}
326 bool BinaryValue::Equals(const Value* other) const {
338 scoped_ptr<DictionaryValue> DictionaryValue::From(scoped_ptr<Value> value) {
340 if (value && value->GetAsDictionary(&out)) {
341 ignore_result(value.release());
348 : Value(TYPE_DICTIONARY) {
384 void DictionaryValue::Set(const std::string& path, scoped_ptr<Value> in_value) {
409 void DictionaryValue::Set(const std::string& path, Value* in_value) {
431 scoped_ptr<Value> in_value) {
432 Value* bare_ptr = in_value.release();
433 // If there's an existing value here, we need to delete it, because
445 Value* in_value) {
470 const Value** out_value) const {
492 bool DictionaryValue::Get(StringPiece path, Value** out_value) {
495 const_cast<const Value**>(out_value));
500 const Value* value;
501 if (!Get(path, &value))
504 return value->GetAsBoolean(bool_value);
509 const Value* value;
510 if (!Get(path, &value))
513 return value->GetAsInteger(out_value);
518 const Value* value;
519 if (!Get(path, &value))
522 return value->GetAsDouble(out_value);
527 const Value* value;
528 if (!Get(path, &value))
531 return value->GetAsString(out_value);
551 const Value* value;
552 bool result = Get(path, &value);
553 if (!result || !value->IsType(TYPE_BINARY))
557 *out_value = static_cast<const BinaryValue*>(value);
571 const Value* value;
572 bool result = Get(path, &value);
573 if (!result || !value->IsType(TYPE_DICTIONARY))
577 *out_value = static_cast<const DictionaryValue*>(value);
591 const Value* value;
592 bool result = Get(path, &value);
593 if (!result || !value->IsType(TYPE_LIST))
597 *out_value = static_cast<const ListValue*>(value);
609 const Value** out_value) const {
615 const Value* entry = entry_iterator->second;
622 Value** out_value) {
625 const_cast<const Value**>(out_value));
630 const Value* value;
631 if (!GetWithoutPathExpansion(key, &value))
634 return value->GetAsBoolean(out_value);
639 const Value* value;
640 if (!GetWithoutPathExpansion(key, &value))
643 return value->GetAsInteger(out_value);
648 const Value* value;
649 if (!GetWithoutPathExpansion(key, &value))
652 return value->GetAsDouble(out_value);
658 const Value* value;
659 if (!GetWithoutPathExpansion(key, &value))
662 return value->GetAsString(out_value);
668 const Value* value;
669 bool result = GetWithoutPathExpansion(key, &value);
670 if (!result || !value->IsType(TYPE_DICTIONARY))
674 *out_value = static_cast<const DictionaryValue*>(value);
692 const Value* value;
693 bool result = GetWithoutPathExpansion(key, &value);
694 if (!result || !value->IsType(TYPE_LIST))
698 *out_value = static_cast<const ListValue*>(value);
712 scoped_ptr<Value>* out_value) {
729 scoped_ptr<Value>* out_value) {
735 Value* entry = entry_iterator->second;
745 scoped_ptr<Value>* out_value) {
774 const Value* merge_value = &it.value();
776 if (merge_value->IsType(Value::TYPE_DICTIONARY)) {
815 bool DictionaryValue::Equals(const Value* other) const {
825 !lhs_it.value().Equals(&rhs_it.value())) {
840 scoped_ptr<ListValue> ListValue::From(scoped_ptr<Value> value) {
842 if (value && value->GetAsList(&out)) {
843 ignore_result(value.release());
849 ListValue::ListValue() : Value(TYPE_LIST) {
862 bool ListValue::Set(size_t index, Value* in_value) {
879 bool ListValue::Set(size_t index, scoped_ptr<Value> in_value) {
883 bool ListValue::Get(size_t index, const Value** out_value) const {
893 bool ListValue::Get(size_t index, Value** out_value) {
896 const_cast<const Value**>(out_value));
900 const Value* value;
901 if (!Get(index, &value))
904 return value->GetAsBoolean(bool_value);
908 const Value* value;
909 if (!Get(index, &value))
912 return value->GetAsInteger(out_value);
916 const Value* value;
917 if (!Get(index, &value))
920 return value->GetAsDouble(out_value);
924 const Value* value;
925 if (!Get(index, &value))
928 return value->GetAsString(out_value);
932 const Value* value;
933 bool result = Get(index, &value);
934 if (!result || !value->IsType(TYPE_BINARY))
938 *out_value = static_cast<const BinaryValue*>(value);
951 const Value* value;
952 bool result = Get(index, &value);
953 if (!result || !value->IsType(TYPE_DICTIONARY))
957 *out_value = static_cast<const DictionaryValue*>(value);
969 const Value* value;
970 bool result = Get(index, &value);
971 if (!result || !value->IsType(TYPE_LIST))
975 *out_value = static_cast<const ListValue*>(value);
986 bool ListValue::Remove(size_t index, scoped_ptr<Value>* out_value) {
999 bool ListValue::Remove(const Value& value, size_t* index) {
1001 if ((*i)->Equals(&value)) {
1015 scoped_ptr<Value>* out_value) {
1024 void ListValue::Append(scoped_ptr<Value> in_value) {
1028 void ListValue::Append(Value* in_value) {
1056 bool ListValue::AppendIfNotPresent(Value* in_value) {
1068 bool ListValue::Insert(size_t index, Value* in_value) {
1077 ListValue::const_iterator ListValue::Find(const Value& value) const {
1078 return std::find_if(list_.begin(), list_.end(), ValueEquals(&value));
1110 bool ListValue::Equals(const Value* other) const {
1129 std::ostream& operator<<(std::ostream& out, const Value& value) {
1131 JSONWriter::WriteWithOptions(value, JSONWriter::OPTIONS_PRETTY_PRINT, &json);