#include "tools/json_schema_compiler/manifest_parse_util.h"
#include <string_view>
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
namespace json_schema_compiler {
namespace manifest_parse_util {
namespace {
ValueTypeConverter;
template <typename T, typename U>
bool ParseHelper(const base::Value::Dict& dict,
std::string_view key,
base::Value::Type expected_type,
ValueTypeConverter<U> type_converter,
T& out,
std::u16string& error,
std::vector<std::string_view>& error_path_reversed) { … }
}
void PopulateInvalidEnumValueError(
std::string_view key,
std::string_view value,
std::u16string& error,
std::vector<std::string_view>& error_path_reversed) { … }
void PopulateInvalidChoiceValueError(
std::string_view key,
std::u16string& error,
std::vector<std::string_view>& error_path_reversed) { … }
void PopulateKeyIsRequiredError(
std::string_view key,
std::u16string& error,
std::vector<std::string_view>& error_path_reversed) { … }
std::u16string GetArrayParseError(size_t error_index,
const std::u16string& item_error) { … }
void PopulateFinalError(std::u16string& error,
std::vector<std::string_view>& error_path_reversed) { … }
const base::Value* FindKeyOfType(
const base::Value::Dict& dict,
std::string_view key,
base::Value::Type expected_type,
std::u16string& error,
std::vector<std::string_view>& error_path_reversed) { … }
bool ParseFromDictionary(const base::Value::Dict& dict,
std::string_view key,
int& out,
std::u16string& error,
std::vector<std::string_view>& error_path_reversed) { … }
bool ParseFromDictionary(const base::Value::Dict& dict,
std::string_view key,
bool& out,
std::u16string& error,
std::vector<std::string_view>& error_path_reversed) { … }
bool ParseFromDictionary(const base::Value::Dict& dict,
std::string_view key,
double& out,
std::u16string& error,
std::vector<std::string_view>& error_path_reversed) { … }
bool ParseFromDictionary(const base::Value::Dict& dict,
std::string_view key,
std::string& out,
std::u16string& error,
std::vector<std::string_view>& error_path_reversed) { … }
}
}