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(string16* /* out_value */) const {
120 bool Value::GetAsString(const StringValue** /* out_value */) const {
124 bool Value::GetAsList(ListValue** /* out_value */) {
128 bool Value::GetAsList(const ListValue** /* out_value */) const {
132 bool Value::GetAsDictionary(DictionaryValue** /* out_value */) {
136 bool Value::GetAsDictionary(const DictionaryValue** /* out_value */) const {
140 Value* Value::DeepCopy() const {
147 scoped_ptr<Value> Value::CreateDeepCopy() const {
151 bool Value::Equals(const Value* other) const {
159 bool Value::Equals(const Value* a, const Value* b) {
165 Value::Value(Type type) : type_(type) {}
167 Value::Value(const Value& that) : type_(that.type_) {}
169 Value& Value::operator=(const Value& that) {
177 : Value(TYPE_BOOLEAN), boolean_value_(in_value) {
181 : Value(TYPE_INTEGER), integer_value_(in_value) {
185 : Value(TYPE_DOUBLE), double_value_(in_value) {
233 bool FundamentalValue::Equals(const Value* other) const {
259 : Value(TYPE_STRING),
265 : Value(TYPE_STRING),
302 bool StringValue::Equals(const Value* other) const {
312 : Value(TYPE_BINARY),
317 : Value(TYPE_BINARY), buffer_(std::move(buffer)), size_(size) {}
341 bool BinaryValue::Equals(const Value* other) const {
353 scoped_ptr<DictionaryValue> DictionaryValue::From(scoped_ptr<Value> value) {
355 if (value && value->GetAsDictionary(&out)) {
356 ignore_result(value.release());
363 : Value(TYPE_DICTIONARY) {
399 void DictionaryValue::Set(const std::string& path, scoped_ptr<Value> in_value) {
424 void DictionaryValue::Set(const std::string& path, Value* in_value) {
451 scoped_ptr<Value> in_value) {
452 Value* bare_ptr = in_value.release();
453 // If there's an existing value here, we need to delete it, because
465 Value* in_value) {
495 const Value** out_value) const {
517 bool DictionaryValue::Get(StringPiece path, Value** out_value) {
520 const_cast<const Value**>(out_value));
525 const Value* value;
526 if (!Get(path, &value))
529 return value->GetAsBoolean(bool_value);
534 const Value* value;
535 if (!Get(path, &value))
538 return value->GetAsInteger(out_value);
543 const Value* value;
544 if (!Get(path, &value))
547 return value->GetAsDouble(out_value);
552 const Value* value;
553 if (!Get(path, &value))
556 return value->GetAsString(out_value);
561 const Value* value;
562 if (!Get(path, &value))
565 return value->GetAsString(out_value);
585 const Value* value;
586 bool result = Get(path, &value);
587 if (!result || !value->IsType(TYPE_BINARY))
591 *out_value = static_cast<const BinaryValue*>(value);
605 const Value* value;
606 bool result = Get(path, &value);
607 if (!result || !value->IsType(TYPE_DICTIONARY))
611 *out_value = static_cast<const DictionaryValue*>(value);
625 const Value* value;
626 bool result = Get(path, &value);
627 if (!result || !value->IsType(TYPE_LIST))
631 *out_value = static_cast<const ListValue*>(value);
643 const Value** out_value) const {
649 const Value* entry = entry_iterator->second;
656 Value** out_value) {
659 const_cast<const Value**>(out_value));
664 const Value* value;
665 if (!GetWithoutPathExpansion(key, &value))
668 return value->GetAsBoolean(out_value);
673 const Value* value;
674 if (!GetWithoutPathExpansion(key, &value))
677 return value->GetAsInteger(out_value);
682 const Value* value;
683 if (!GetWithoutPathExpansion(key, &value))
686 return value->GetAsDouble(out_value);
692 const Value* value;
693 if (!GetWithoutPathExpansion(key, &value))
696 return value->GetAsString(out_value);
701 const Value* value;
702 if (!GetWithoutPathExpansion(key, &value))
705 return value->GetAsString(out_value);
711 const Value* value;
712 bool result = GetWithoutPathExpansion(key, &value);
713 if (!result || !value->IsType(TYPE_DICTIONARY))
717 *out_value = static_cast<const DictionaryValue*>(value);
735 const Value* value;
736 bool result = GetWithoutPathExpansion(key, &value);
737 if (!result || !value->IsType(TYPE_LIST))
741 *out_value = static_cast<const ListValue*>(value);
755 scoped_ptr<Value>* out_value) {
772 scoped_ptr<Value>* out_value) {
778 Value* entry = entry_iterator->second;
788 scoped_ptr<Value>* out_value) {
817 const Value* merge_value = &it.value();
819 if (merge_value->IsType(Value::TYPE_DICTIONARY)) {
858 bool DictionaryValue::Equals(const Value* other) const {
868 !lhs_it.value().Equals(&rhs_it.value())) {
883 scoped_ptr<ListValue> ListValue::From(scoped_ptr<Value> value) {
885 if (value && value->GetAsList(&out)) {
886 ignore_result(value.release());
892 ListValue::ListValue() : Value(TYPE_LIST) {
905 bool ListValue::Set(size_t index, Value* in_value) {
922 bool ListValue::Set(size_t index, scoped_ptr<Value> in_value) {
926 bool ListValue::Get(size_t index, const Value** out_value) const {
936 bool ListValue::Get(size_t index, Value** out_value) {
939 const_cast<const Value**>(out_value));
943 const Value* value;
944 if (!Get(index, &value))
947 return value->GetAsBoolean(bool_value);
951 const Value* value;
952 if (!Get(index, &value))
955 return value->GetAsInteger(out_value);
959 const Value* value;
960 if (!Get(index, &value))
963 return value->GetAsDouble(out_value);
967 const Value* value;
968 if (!Get(index, &value))
971 return value->GetAsString(out_value);
975 const Value* value;
976 if (!Get(index, &value))
979 return value->GetAsString(out_value);
983 const Value* value;
984 bool result = Get(index, &value);
985 if (!result || !value->IsType(TYPE_BINARY))
989 *out_value = static_cast<const BinaryValue*>(value);
1002 const Value* value;
1003 bool result = Get(index, &value);
1004 if (!result || !value->IsType(TYPE_DICTIONARY))
1008 *out_value = static_cast<const DictionaryValue*>(value);
1020 const Value* value;
1021 bool result = Get(index, &value);
1022 if (!result || !value->IsType(TYPE_LIST))
1026 *out_value = static_cast<const ListValue*>(value);
1037 bool ListValue::Remove(size_t index, scoped_ptr<Value>* out_value) {
1050 bool ListValue::Remove(const Value& value, size_t* index) {
1052 if ((*i)->Equals(&value)) {
1066 scoped_ptr<Value>* out_value) {
1075 void ListValue::Append(scoped_ptr<Value> in_value) {
1079 void ListValue::Append(Value* in_value) {
1118 bool ListValue::AppendIfNotPresent(Value* in_value) {
1130 bool ListValue::Insert(size_t index, Value* in_value) {
1139 ListValue::const_iterator ListValue::Find(const Value& value) const {
1140 return std::find_if(list_.begin(), list_.end(), ValueEquals(&value));
1172 bool ListValue::Equals(const Value* other) const {
1197 Value& value) {
1199 JSONWriter::WriteWithOptions(value, JSONWriter::OPTIONS_PRETTY_PRINT, &json);