#include "services/preferences/public/cpp/dictionary_value_update.h"
#include <iterator>
#include <optional>
#include <utility>
#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
namespace prefs {
DictionaryValueUpdate::DictionaryValueUpdate(UpdateCallback report_update,
base::Value::Dict* value,
std::vector<std::string> path)
: … { … }
DictionaryValueUpdate::~DictionaryValueUpdate() = default;
bool DictionaryValueUpdate::HasKey(std::string_view key) const { … }
size_t DictionaryValueUpdate::size() const { … }
bool DictionaryValueUpdate::empty() const { … }
void DictionaryValueUpdate::Clear() { … }
void DictionaryValueUpdate::Set(std::string_view path, base::Value in_value) { … }
void DictionaryValueUpdate::SetBoolean(std::string_view path, bool in_value) { … }
void DictionaryValueUpdate::SetInteger(std::string_view path, int in_value) { … }
void DictionaryValueUpdate::SetDouble(std::string_view path, double in_value) { … }
void DictionaryValueUpdate::SetString(std::string_view path,
std::string_view in_value) { … }
void DictionaryValueUpdate::SetString(std::string_view path,
const std::u16string& in_value) { … }
std::unique_ptr<DictionaryValueUpdate> DictionaryValueUpdate::SetDictionary(
std::string_view path,
base::Value::Dict in_value) { … }
base::Value* DictionaryValueUpdate::SetKey(std::string_view key,
base::Value value) { … }
void DictionaryValueUpdate::SetWithoutPathExpansion(std::string_view key,
base::Value in_value) { … }
std::unique_ptr<DictionaryValueUpdate>
DictionaryValueUpdate::SetDictionaryWithoutPathExpansion(
std::string_view path,
base::Value::Dict in_value) { … }
bool DictionaryValueUpdate::GetBoolean(std::string_view path,
bool* out_value) const { … }
bool DictionaryValueUpdate::GetInteger(std::string_view path,
int* out_value) const { … }
bool DictionaryValueUpdate::GetDouble(std::string_view path,
double* out_value) const { … }
bool DictionaryValueUpdate::GetString(std::string_view path,
std::string* out_value) const { … }
bool DictionaryValueUpdate::GetDictionary(
std::string_view path,
const base::Value::Dict** out_value) const { … }
bool DictionaryValueUpdate::GetDictionary(
std::string_view path,
std::unique_ptr<DictionaryValueUpdate>* out_value) { … }
bool DictionaryValueUpdate::GetDictionaryWithoutPathExpansion(
std::string_view key,
std::unique_ptr<DictionaryValueUpdate>* out_value) { … }
bool DictionaryValueUpdate::GetListWithoutPathExpansion(
std::string_view key,
base::Value::List** out_value) { … }
bool DictionaryValueUpdate::Remove(std::string_view path) { … }
bool DictionaryValueUpdate::RemoveWithoutPathExpansion(std::string_view key,
base::Value* out_value) { … }
base::Value::Dict* DictionaryValueUpdate::AsDict() { … }
const base::Value::Dict* DictionaryValueUpdate::AsConstDict() const { … }
void DictionaryValueUpdate::RecordKey(std::string_view key) { … }
void DictionaryValueUpdate::RecordPath(std::string_view path) { … }
void DictionaryValueUpdate::RecordSplitPath(
const std::vector<std::string_view>& path) { … }
std::vector<std::string_view> DictionaryValueUpdate::SplitPath(
std::string_view path) { … }
std::vector<std::string> DictionaryValueUpdate::ConcatPath(
const std::vector<std::string>& base_path,
std::string_view path) { … }
std::vector<std::string> DictionaryValueUpdate::ConcatPath(
const std::vector<std::string>& base_path,
const std::vector<std::string_view>& path) { … }
}