Lines Matching refs:Value
30 static_cast<size_t>(Value::Type::LIST) + 1,
33 std::unique_ptr<Value> CopyWithoutEmptyChildren(const Value& node);
38 std::unique_ptr<Value> CopyListWithoutEmptyChildren(const Value& list) { in CopyListWithoutEmptyChildren()
39 Value copy(Value::Type::LIST); in CopyListWithoutEmptyChildren()
41 std::unique_ptr<Value> child_copy = CopyWithoutEmptyChildren(entry); in CopyListWithoutEmptyChildren()
46 : std::make_unique<Value>(std::move(copy)); in CopyListWithoutEmptyChildren()
53 std::unique_ptr<Value> child_copy = CopyWithoutEmptyChildren(it.value()); in CopyDictionaryWithoutEmptyChildren()
63 std::unique_ptr<Value> CopyWithoutEmptyChildren(const Value& node) { in CopyWithoutEmptyChildren()
65 case Value::Type::LIST: in CopyWithoutEmptyChildren()
68 case Value::Type::DICTIONARY: in CopyWithoutEmptyChildren()
73 return std::make_unique<Value>(node.Clone()); in CopyWithoutEmptyChildren()
80 std::unique_ptr<Value> Value::CreateWithCopiedBuffer(const char* buffer, in CreateWithCopiedBuffer()
82 return std::make_unique<Value>(BlobStorage(buffer, buffer + size)); in CreateWithCopiedBuffer()
86 Value Value::FromUniquePtrValue(std::unique_ptr<Value> val) { in FromUniquePtrValue()
91 std::unique_ptr<Value> Value::ToUniquePtrValue(Value val) { in ToUniquePtrValue()
92 return std::make_unique<Value>(std::move(val)); in ToUniquePtrValue()
95 Value::Value(Value&& that) noexcept { in Value() function in base::Value
99 Value::Value() noexcept : type_(Type::NONE) {} in Value() function in base::Value
101 Value::Value(Type type) : type_(type) { in Value() function in base::Value
128 Value::Value(bool in_bool) : type_(Type::BOOLEAN), bool_value_(in_bool) {} in Value() function in base::Value
130 Value::Value(int in_int) : type_(Type::INTEGER), int_value_(in_int) {} in Value() function in base::Value
132 Value::Value(const char* in_string) : Value(std::string(in_string)) {} in Value() function in base::Value
134 Value::Value(std::string_view in_string) : Value(std::string(in_string)) {} in Value() function in base::Value
136 Value::Value(std::string&& in_string) noexcept in Value() function in base::Value
141 Value::Value(const char16_t* in_string16) in Value() function in base::Value
142 : Value(std::u16string_view(in_string16)) {} in Value()
144 Value::Value(std::u16string_view in_string16) in Value() function in base::Value
145 : Value(UTF16ToUTF8(in_string16)) {} in Value()
147 Value::Value(const BlobStorage& in_blob) in Value() function in base::Value
150 Value::Value(BlobStorage&& in_blob) noexcept in Value() function in base::Value
153 Value::Value(const DictStorage& in_dict) : type_(Type::DICTIONARY), dict_() { in Value() function in base::Value
157 std::make_unique<Value>(it.second->Clone())); in Value()
161 Value::Value(DictStorage&& in_dict) noexcept in Value() function in base::Value
164 Value::Value(const ListStorage& in_list) : type_(Type::LIST), list_() { in Value() function in base::Value
170 Value::Value(ListStorage&& in_list) noexcept in Value() function in base::Value
173 Value& Value::operator=(Value&& that) noexcept { in operator =()
180 Value Value::Clone() const { in Clone()
183 return Value(); in Clone()
185 return Value(bool_value_); in Clone()
187 return Value(int_value_); in Clone()
189 return Value(string_value_); in Clone()
191 return Value(binary_value_); in Clone()
193 return Value(dict_); in Clone()
195 return Value(list_); in Clone()
199 return Value(); in Clone()
202 Value::~Value() { in ~Value()
207 const char* Value::GetTypeName(Value::Type type) { in GetTypeName()
213 bool Value::GetBool() const { in GetBool()
218 int Value::GetInt() const { in GetInt()
223 const std::string& Value::GetString() const { in GetString()
228 const Value::BlobStorage& Value::GetBlob() const { in GetBlob()
233 Value::ListStorage& Value::GetList() { in GetList()
238 const Value::ListStorage& Value::GetList() const { in GetList()
243 Value* Value::FindKey(std::string_view key) { in FindKey()
244 return const_cast<Value*>(static_cast<const Value*>(this)->FindKey(key)); in FindKey()
247 const Value* Value::FindKey(std::string_view key) const { in FindKey()
255 Value* Value::FindKeyOfType(std::string_view key, Type type) { in FindKeyOfType()
256 return const_cast<Value*>( in FindKeyOfType()
257 static_cast<const Value*>(this)->FindKeyOfType(key, type)); in FindKeyOfType()
260 const Value* Value::FindKeyOfType(std::string_view key, Type type) const { in FindKeyOfType()
261 const Value* result = FindKey(key); in FindKeyOfType()
267 bool Value::RemoveKey(std::string_view key) { in RemoveKey()
273 Value* Value::SetKey(std::string_view key, Value value) { in SetKey()
277 auto val_ptr = std::make_unique<Value>(std::move(value)); in SetKey()
286 Value* Value::SetKey(std::string&& key, Value value) { in SetKey()
290 std::make_unique<Value>(std::move(value))) in SetKey()
294 Value* Value::SetKey(const char* key, Value value) { in SetKey()
298 Value* Value::FindPath(std::initializer_list<std::string_view> path) { in FindPath()
299 return const_cast<Value*>(const_cast<const Value*>(this)->FindPath(path)); in FindPath()
302 Value* Value::FindPath(span<const std::string_view> path) { in FindPath()
303 return const_cast<Value*>(const_cast<const Value*>(this)->FindPath(path)); in FindPath()
306 const Value* Value::FindPath( in FindPath()
312 const Value* Value::FindPath(span<const std::string_view> path) const { in FindPath()
313 const Value* cur = this; in FindPath()
321 Value* Value::FindPathOfType(std::initializer_list<std::string_view> path, in FindPathOfType()
323 return const_cast<Value*>( in FindPathOfType()
324 const_cast<const Value*>(this)->FindPathOfType(path, type)); in FindPathOfType()
327 Value* Value::FindPathOfType(span<const std::string_view> path, Type type) { in FindPathOfType()
328 return const_cast<Value*>( in FindPathOfType()
329 const_cast<const Value*>(this)->FindPathOfType(path, type)); in FindPathOfType()
332 const Value* Value::FindPathOfType(std::initializer_list<std::string_view> path, in FindPathOfType()
338 const Value* Value::FindPathOfType(span<const std::string_view> path, in FindPathOfType()
340 const Value* result = FindPath(path); in FindPathOfType()
346 Value* Value::SetPath(std::initializer_list<std::string_view> path, in SetPath()
347 Value value) { in SetPath()
352 Value* Value::SetPath(span<const std::string_view> path, Value value) { in SetPath()
357 Value* cur = this; in SetPath()
369 found, path_component, std::make_unique<Value>(Type::DICTIONARY)); in SetPath()
382 bool Value::RemovePath(std::initializer_list<std::string_view> path) { in RemovePath()
387 bool Value::RemovePath(span<const std::string_view> path) { in RemovePath()
405 Value::dict_iterator_proxy Value::DictItems() { in DictItems()
410 Value::const_dict_iterator_proxy Value::DictItems() const { in DictItems()
415 size_t Value::DictSize() const { in DictSize()
420 bool Value::DictEmpty() const { in DictEmpty()
425 bool Value::GetAsBoolean(bool* out_value) const { in GetAsBoolean()
433 bool Value::GetAsInteger(int* out_value) const { in GetAsInteger()
441 bool Value::GetAsString(std::string* out_value) const { in GetAsString()
449 bool Value::GetAsString(std::u16string* out_value) const { in GetAsString()
457 bool Value::GetAsString(const Value** out_value) const { in GetAsString()
459 *out_value = static_cast<const Value*>(this); in GetAsString()
465 bool Value::GetAsString(std::string_view* out_value) const { in GetAsString()
473 bool Value::GetAsList(ListValue** out_value) { in GetAsList()
481 bool Value::GetAsList(const ListValue** out_value) const { in GetAsList()
489 bool Value::GetAsDictionary(DictionaryValue** out_value) { in GetAsDictionary()
497 bool Value::GetAsDictionary(const DictionaryValue** out_value) const { in GetAsDictionary()
505 Value* Value::DeepCopy() const { in DeepCopy()
506 return new Value(Clone()); in DeepCopy()
509 std::unique_ptr<Value> Value::CreateDeepCopy() const { in CreateDeepCopy()
510 return std::make_unique<Value>(Clone()); in CreateDeepCopy()
513 bool operator==(const Value& lhs, const Value& rhs) { in operator ==()
518 case Value::Type::NONE: in operator ==()
520 case Value::Type::BOOLEAN: in operator ==()
522 case Value::Type::INTEGER: in operator ==()
524 case Value::Type::STRING: in operator ==()
526 case Value::Type::BINARY: in operator ==()
530 case Value::Type::DICTIONARY: in operator ==()
538 case Value::Type::LIST: in operator ==()
546 bool operator!=(const Value& lhs, const Value& rhs) { in operator !=()
550 bool operator<(const Value& lhs, const Value& rhs) { in operator <()
555 case Value::Type::NONE: in operator <()
557 case Value::Type::BOOLEAN: in operator <()
559 case Value::Type::INTEGER: in operator <()
561 case Value::Type::STRING: in operator <()
563 case Value::Type::BINARY: in operator <()
567 case Value::Type::DICTIONARY: in operator <()
571 [](const Value::DictStorage::value_type& u, in operator <()
572 const Value::DictStorage::value_type& v) { in operator <()
575 case Value::Type::LIST: in operator <()
583 bool operator>(const Value& lhs, const Value& rhs) { in operator >()
587 bool operator<=(const Value& lhs, const Value& rhs) { in operator <=()
591 bool operator>=(const Value& lhs, const Value& rhs) { in operator >=()
595 bool Value::Equals(const Value* other) const { in Equals()
600 void Value::InternalMoveConstructFrom(Value&& that) { in InternalMoveConstructFrom()
627 void Value::InternalCleanup() { in InternalCleanup()
654 std::unique_ptr<Value> value) { in From()
663 DictionaryValue::DictionaryValue() : Value(Type::DICTIONARY) {} in DictionaryValue()
664 DictionaryValue::DictionaryValue(const DictStorage& in_dict) : Value(in_dict) {} in DictionaryValue()
666 : Value(std::move(in_dict)) {} in DictionaryValue()
679 Value* DictionaryValue::Set(std::string_view path, in Set()
680 std::unique_ptr<Value> in_value) { in Set()
685 Value* current_dictionary = this; in Set()
691 Value* child_dictionary = in Set()
695 current_dictionary->SetKey(key, Value(Type::DICTIONARY)); in Set()
706 Value* DictionaryValue::SetBoolean(std::string_view path, bool in_value) { in SetBoolean()
707 return Set(path, std::make_unique<Value>(in_value)); in SetBoolean()
710 Value* DictionaryValue::SetInteger(std::string_view path, int in_value) { in SetInteger()
711 return Set(path, std::make_unique<Value>(in_value)); in SetInteger()
714 Value* DictionaryValue::SetString(std::string_view path, in SetString()
716 return Set(path, std::make_unique<Value>(in_value)); in SetString()
719 Value* DictionaryValue::SetString(std::string_view path, in SetString()
721 return Set(path, std::make_unique<Value>(in_value)); in SetString()
735 Value* DictionaryValue::SetWithoutPathExpansion( in SetWithoutPathExpansion()
737 std::unique_ptr<Value> in_value) { in SetWithoutPathExpansion()
749 const Value** out_value) const { in Get()
769 bool DictionaryValue::Get(std::string_view path, Value** out_value) { in Get()
771 path, const_cast<const Value**>(out_value)); in Get()
776 const Value* value; in GetBoolean()
784 const Value* value; in GetInteger()
793 const Value* value; in GetString()
802 const Value* value; in GetString()
825 const Value** out_value) const { in GetBinary()
826 const Value* value; in GetBinary()
837 bool DictionaryValue::GetBinary(std::string_view path, Value** out_value) { in GetBinary()
839 path, const_cast<const Value**>(out_value)); in GetBinary()
844 const Value* value; in GetDictionary()
863 const Value* value; in GetList()
880 const Value** out_value) const { in GetWithoutPathExpansion()
892 Value** out_value) { in GetWithoutPathExpansion()
894 key, const_cast<const Value**>(out_value)); in GetWithoutPathExpansion()
899 const Value* value; in GetBooleanWithoutPathExpansion()
908 const Value* value; in GetIntegerWithoutPathExpansion()
918 const Value* value; in GetStringWithoutPathExpansion()
928 const Value* value; in GetStringWithoutPathExpansion()
938 const Value* value; in GetDictionaryWithoutPathExpansion()
961 const Value* value; in GetListWithoutPathExpansion()
979 std::unique_ptr<Value>* out_value) { in Remove()
997 std::unique_ptr<Value>* out_value) { in RemoveWithoutPathExpansion()
1010 std::unique_ptr<Value>* out_value) { in RemovePath()
1040 const Value* merge_value = &it.value(); in MergeDictionary()
1078 std::unique_ptr<ListValue> ListValue::From(std::unique_ptr<Value> value) { in From()
1087 ListValue::ListValue() : Value(Type::LIST) {} in ListValue()
1088 ListValue::ListValue(const ListStorage& in_list) : Value(in_list) {} in ListValue()
1090 : Value(std::move(in_list)) {} in ListValue()
1100 bool ListValue::Set(size_t index, std::unique_ptr<Value> in_value) { in Set()
1111 bool ListValue::Get(size_t index, const Value** out_value) const { in Get()
1121 bool ListValue::Get(size_t index, Value** out_value) { in Get()
1123 index, const_cast<const Value**>(out_value)); in Get()
1127 const Value* value; in GetBoolean()
1135 const Value* value; in GetInteger()
1143 const Value* value; in GetString()
1151 const Value* value; in GetString()
1160 const Value* value; in GetDictionary()
1177 const Value* value; in GetList()
1193 bool ListValue::Remove(size_t index, std::unique_ptr<Value>* out_value) { in Remove()
1198 *out_value = std::make_unique<Value>(std::move(list_[index])); in Remove()
1204 bool ListValue::Remove(const Value& value, size_t* index) { in Remove()
1218 std::unique_ptr<Value>* out_value) { in Erase()
1220 *out_value = std::make_unique<Value>(std::move(*iter)); in Erase()
1225 void ListValue::Append(std::unique_ptr<Value> in_value) { in Append()
1257 bool ListValue::AppendIfNotPresent(std::unique_ptr<Value> in_value) { in AppendIfNotPresent()
1266 bool ListValue::Insert(size_t index, std::unique_ptr<Value> in_value) { in Insert()
1275 ListValue::const_iterator ListValue::Find(const Value& value) const { in Find()
1296 std::ostream& operator<<(std::ostream& out, const Value& value) { in operator <<()
1302 std::ostream& operator<<(std::ostream& out, const Value::Type& type) { in operator <<()
1306 return out << Value::GetTypeName(type); in operator <<()