chromium/third_party/libaddressinput/src/cpp/src/region_data_builder.cc

// Copyright (C) 2014 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include <libaddressinput/region_data_builder.h>

#include <libaddressinput/address_data.h>
#include <libaddressinput/preload_supplier.h>
#include <libaddressinput/region_data.h>

#include <cassert>
#include <cstddef>
#include <string>
#include <vector>

#include "language.h"
#include "lookup_key.h"
#include "region_data_constants.h"
#include "rule.h"
#include "util/size.h"

namespace i18n {
namespace addressinput {

namespace {

// The maximum depth of lookup keys.
const size_t kLookupKeysMaxDepth =;

// Does not take ownership of |parent_region|, which is not allowed to be
// nullptr.
void BuildRegionTreeRecursively(
    const std::map<std::string, const Rule*>& rules,
    std::map<std::string, const Rule*>::const_iterator hint,
    const LookupKey& parent_key,
    RegionData* parent_region,
    const std::vector<std::string>& keys,
    bool prefer_latin_name,
    size_t region_max_depth) {}

// The caller owns the result.
RegionData* BuildRegion(const std::map<std::string, const Rule*>& rules,
                        const std::string& region_code,
                        const Language& language) {}

}  // namespace

RegionDataBuilder::RegionDataBuilder(PreloadSupplier* supplier)
    :{}

RegionDataBuilder::~RegionDataBuilder() {}

const RegionData& RegionDataBuilder::Build(
    const std::string& region_code,
    const std::string& ui_language_tag,
    std::string* best_region_tree_language_tag) {}

}  // namespace addressinput
}  // namespace i18n