chromium/tools/json_schema_compiler/manifest_parse_util.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Alias for a pointer to a base::Value const function which converts the
// base::Value into type T. This is used by ParseHelper below.
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) {}

}  // namespace

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) {}

}  // namespace manifest_parse_util
}  // namespace json_schema_compiler