Lines Matching defs:const

97   // DEPRECATED, use std::make_unique<Value>(const BlobStorage&) instead.
99 static std::unique_ptr<Value> CreateWithCopiedBuffer(const char* buffer,
111 Value Clone() const;
117 // Value(const char*) and Value(const char16_t*) are required despite
121 explicit Value(const char* in_string);
124 explicit Value(const char16_t* in_string16);
127 explicit Value(const BlobStorage& in_blob);
130 explicit Value(const DictStorage& in_dict);
133 explicit Value(const ListStorage& in_list);
141 static const char* GetTypeName(Type type);
144 Type type() const { return type_; }
147 bool is_none() const { return type() == Type::NONE; }
148 bool is_bool() const { return type() == Type::BOOLEAN; }
149 bool is_int() const { return type() == Type::INTEGER; }
150 bool is_string() const { return type() == Type::STRING; }
151 bool is_blob() const { return type() == Type::BINARY; }
152 bool is_dict() const { return type() == Type::DICTIONARY; }
153 bool is_list() const { return type() == Type::LIST; }
156 bool GetBool() const;
157 int GetInt() const;
158 const std::string& GetString() const;
159 const BlobStorage& GetBlob() const;
162 const ListStorage& GetList() const;
173 const Value* FindKey(std::string_view key) const;
185 const Value* FindKeyOfType(std::string_view key, Type type) const;
197 // This overload is necessary to avoid ambiguity for const char* arguments.
198 Value* SetKey(const char* key, Value value);
229 Value* FindPath(span<const std::string_view> path);
230 const Value* FindPath(std::initializer_list<std::string_view> path) const;
231 const Value* FindPath(span<const std::string_view> path) const;
240 Value* FindPathOfType(span<const std::string_view> path, Type type);
241 const Value* FindPathOfType(std::initializer_list<std::string_view> path,
242 Type type) const;
243 const Value* FindPathOfType(span<const std::string_view> path,
244 Type type) const;
263 Value* SetPath(span<const std::string_view> path, Value value);
280 bool RemovePath(span<const std::string_view> path);
291 const_dict_iterator_proxy DictItems() const;
295 size_t DictSize() const;
296 bool DictEmpty() const;
303 bool GetAsBoolean(bool* out_value) const;
305 bool GetAsInteger(int* out_value) const;
307 bool GetAsString(std::string* out_value) const;
308 bool GetAsString(std::u16string* out_value) const;
309 bool GetAsString(const Value** out_value) const;
310 bool GetAsString(std::string_view* out_value) const;
314 bool GetAsList(const ListValue** out_value) const;
317 bool GetAsDictionary(const DictionaryValue** out_value) const;
326 Value* DeepCopy() const;
329 std::unique_ptr<Value> CreateDeepCopy() const;
333 friend bool operator==(const Value& lhs, const Value& rhs);
334 friend bool operator!=(const Value& lhs, const Value& rhs);
335 friend bool operator<(const Value& lhs, const Value& rhs);
336 friend bool operator>(const Value& lhs, const Value& rhs);
337 friend bool operator<=(const Value& lhs, const Value& rhs);
338 friend bool operator>=(const Value& lhs, const Value& rhs);
341 // DEPRECATED, use operator==(const Value& lhs, const Value& rhs) instead.
343 bool Equals(const Value* other) const;
347 size_t EstimateMemoryUsage() const;
367 Value(const Value&) = delete;
368 Value& operator=(const Value&) = delete;
383 explicit DictionaryValue(const DictStorage& in_dict);
388 bool HasKey(std::string_view key) const;
391 size_t size() const { return dict_.size(); }
394 bool empty() const { return dict_.empty(); }
418 // DEPRECATED, use Value::SetPath(path, Value(const string& 16)) instead.
419 Value* SetString(std::string_view path, const std::u16string& in_value);
442 bool Get(std::string_view path, const Value** out_value) const;
451 bool GetBoolean(std::string_view path, bool* out_value) const;
453 bool GetInteger(std::string_view path, int* out_value) const;
455 bool GetString(std::string_view path, std::string* out_value) const;
457 bool GetString(std::string_view path, std::u16string* out_value) const;
459 bool GetStringASCII(std::string_view path, std::string* out_value) const;
461 bool GetBinary(std::string_view path, const Value** out_value) const;
466 const DictionaryValue** out_value) const;
470 bool GetList(std::string_view path, const ListValue** out_value) const;
478 const Value** out_value) const;
483 bool* out_value) const;
486 int* out_value) const;
489 std::string* out_value) const;
492 std::u16string* out_value) const;
496 const DictionaryValue** out_value) const;
502 const ListValue** out_value) const;
530 std::unique_ptr<DictionaryValue> DeepCopyWithoutEmptyChildren() const;
537 void MergeDictionary(const DictionaryValue* dictionary);
547 explicit Iterator(const DictionaryValue& target);
548 Iterator(const Iterator& other);
551 bool IsAtEnd() const { return it_ == target_.dict_.end(); }
554 const std::string& key() const { return it_->first; }
555 const Value& value() const { return *it_->second; }
558 const DictionaryValue& target_;
568 const_iterator begin() const { return dict_.begin(); }
569 const_iterator end() const { return dict_.end(); }
573 DictionaryValue* DeepCopy() const;
576 std::unique_ptr<DictionaryValue> CreateDeepCopy() const;
589 explicit ListValue(const ListStorage& in_list);
598 size_t GetSize() const { return list_.size(); }
602 bool empty() const { return list_.empty(); }
621 bool Get(size_t index, const Value** out_value) const;
629 bool GetBoolean(size_t index, bool* out_value) const;
631 bool GetInteger(size_t index, int* out_value) const;
633 bool GetString(size_t index, std::string* out_value) const;
634 bool GetString(size_t index, std::u16string* out_value) const;
636 bool GetDictionary(size_t index, const DictionaryValue** out_value) const;
641 bool GetList(size_t index, const ListValue** out_value) const;
656 bool Remove(const Value& value, size_t* index);
674 void AppendString(const std::u16string& in_value);
676 void AppendStrings(const std::vector<std::string>& in_values);
677 void AppendStrings(const std::vector<std::u16string>& in_values);
693 const_iterator Find(const Value& value) const;
706 const_iterator begin() const { return list_.begin(); }
708 const_iterator end() const { return list_.end(); }
712 ListValue* DeepCopy() const;
715 std::unique_ptr<ListValue> CreateDeepCopy() const;
724 virtual bool Serialize(const Value& root) = 0;
747 std::ostream& operator<<(std::ostream& out, const Value& value);
750 const DictionaryValue& value) {
751 return out << static_cast<const Value&>(value);
754 inline std::ostream& operator<<(std::ostream& out, const ListValue& value) {
755 return out << static_cast<const Value&>(value);
759 std::ostream& operator<<(std::ostream& out, const Value::Type& type);