chromium/third_party/libaddressinput/src/cpp/src/address_input_helper.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/address_input_helper.h>

#include <libaddressinput/address_data.h>
#include <libaddressinput/address_field.h>
#include <libaddressinput/address_metadata.h>
#include <libaddressinput/preload_supplier.h>

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

#include <re2/re2.h>

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

namespace i18n {
namespace addressinput {

// Used for building a hierarchy of rules, each one connected to its parent.
struct Node {};

namespace {

const char kLookupKeySeparator =;

const size_t kHierarchyDepth =;

// Gets the best name for the entity represented by the current rule, using the
// language provided. The language is currently used to distinguish whether a
// Latin-script name should be fetched; if it is not explicitly Latin-script, we
// prefer IDs over names (so return CA instead of California for an English
// user.) If there is no Latin-script name, we fall back to the ID.
std::string GetBestName(const Language& language, const Rule& rule) {}

void FillAddressFromMatchedRules(
    const std::vector<Node>* hierarchy,
    AddressData* address) {}

}  // namespace

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

AddressInputHelper::~AddressInputHelper() = default;

void AddressInputHelper::FillAddress(AddressData* address) const {}

void AddressInputHelper::CheckChildrenForPostCodeMatches(
    const AddressData& address,
    const LookupKey& lookup_key,
    const Node* parent,
    // An array of vectors.
    std::vector<Node>* hierarchy) const {}

}  // namespace addressinput
}  // namespace i18n