chromium/components/autofill/core/browser/data_model/autofill_structured_address.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 "components/autofill/core/browser/data_model/autofill_structured_address.h"

#include <string>
#include <utility>

#include "base/containers/contains.h"
#include "base/containers/fixed_flat_set.h"
#include "base/feature_list.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/data_model/autofill_structured_address_component.h"
#include "components/autofill/core/browser/data_model/autofill_structured_address_regex_provider.h"
#include "components/autofill/core/browser/data_model/autofill_structured_address_utils.h"
#include "components/autofill/core/browser/field_type_utils.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/geo/address_rewriter.h"
#include "components/autofill/core/browser/geo/alternative_state_name_map.h"
#include "components/autofill/core/common/autofill_features.h"

namespace autofill {

std::u16string AddressComponentWithRewriter::GetValueForComparison(
    const std::u16string& value,
    const AddressComponent& other) const {}

StreetNameNode::StreetNameNode(SubcomponentsList children)
    :{}

StreetNameNode::~StreetNameNode() = default;

StreetLocationNode::StreetLocationNode(SubcomponentsList children)
    :{}

StreetLocationNode::~StreetLocationNode() = default;

HouseNumberNode::HouseNumberNode(SubcomponentsList children)
    :{}

HouseNumberNode::~HouseNumberNode() = default;

FloorNode::FloorNode(SubcomponentsList children)
    :{}

FloorNode::~FloorNode() = default;

ApartmentNode::ApartmentNode(SubcomponentsList children)
    :{}

ApartmentNode::~ApartmentNode() = default;

SubPremiseNode::SubPremiseNode(SubcomponentsList children)
    :{}

SubPremiseNode::~SubPremiseNode() = default;

// Address are mergeable if one is a subset of the other one.
// Take the longer one. If both addresses have the same tokens apply a recursive
// strategy to merge the substructure.
StreetAddressNode::StreetAddressNode(SubcomponentsList children)
    :{}

StreetAddressNode::~StreetAddressNode() = default;

std::vector<const re2::RE2*>
StreetAddressNode::GetParseRegularExpressionsByRelevance() const {}

void StreetAddressNode::ParseValueAndAssignSubcomponentsByFallbackMethod() {}

bool StreetAddressNode::HasNewerValuePrecedenceInMerging(
    const AddressComponent& newer_component) const {}

void StreetAddressNode::UnsetValue() {}

void StreetAddressNode::SetValue(std::u16string value,
                                 VerificationStatus status) {}

void StreetAddressNode::CalculateAddressLines() {}

bool StreetAddressNode::IsValueValid() const {}

std::u16string StreetAddressNode::GetValueForOtherSupportedType(
    FieldType field_type) const {}

std::u16string StreetAddressNode::GetAddressLine(FieldType type) const {}

// Implements support for setting the value of the individual address lines.
void StreetAddressNode::SetValueForOtherSupportedType(
    FieldType field_type,
    const std::u16string& value,
    const VerificationStatus& status) {}

void StreetAddressNode::PostAssignSanitization() {}

const FieldTypeSet StreetAddressNode::GetAdditionalSupportedFieldTypes() const {}

// Country codes are mergeable if they are the same of if one is empty.
// For merging, pick the non-empty one.
CountryCodeNode::CountryCodeNode(SubcomponentsList children)
    :{}

CountryCodeNode::~CountryCodeNode() = default;

// DependentLocalities are mergeable when the tokens of one is a subset of the
// other one. Take the longer one.
DependentLocalityNode::DependentLocalityNode(SubcomponentsList children)
    :{}

DependentLocalityNode::~DependentLocalityNode() = default;

// Cities are mergeable when the tokens of one is a subset of the other one.
// Take the shorter non-empty one.
CityNode::CityNode(SubcomponentsList children)
    :{}

CityNode::~CityNode() = default;

// States are mergeable when the tokens of one is a subset of the other one.
// Take the shorter non-empty one.
StateNode::StateNode(SubcomponentsList children)
    :{}

StateNode::~StateNode() = default;

std::optional<std::u16string> StateNode::GetCanonicalizedValue() const {}

// Zips are mergeable when one is a substring of the other one.
// For merging, the shorter substring is taken.
PostalCodeNode::PostalCodeNode(SubcomponentsList children)
    :{}

PostalCodeNode::~PostalCodeNode() = default;

std::u16string PostalCodeNode::GetNormalizedValue() const {}

std::u16string PostalCodeNode::GetValueForComparison(
    const std::u16string& value,
    const AddressComponent& other) const {}

SortingCodeNode::SortingCodeNode(SubcomponentsList children)
    :{}

SortingCodeNode::~SortingCodeNode() = default;

LandmarkNode::LandmarkNode(SubcomponentsList children)
    :{}

LandmarkNode::~LandmarkNode() = default;

BetweenStreetsNode::BetweenStreetsNode(SubcomponentsList children)
    :{}

BetweenStreetsNode::~BetweenStreetsNode() = default;

BetweenStreets1Node::BetweenStreets1Node(SubcomponentsList children)
    :{}

BetweenStreets1Node::~BetweenStreets1Node() = default;

BetweenStreets2Node::BetweenStreets2Node(SubcomponentsList children)
    :{}

BetweenStreets2Node::~BetweenStreets2Node() = default;

AdminLevel2Node::AdminLevel2Node(SubcomponentsList children)
    :{}

AdminLevel2Node::~AdminLevel2Node() = default;

AddressOverflowNode::AddressOverflowNode(SubcomponentsList children)
    :{}

AddressOverflowNode::~AddressOverflowNode() = default;

AddressOverflowAndLandmarkNode::AddressOverflowAndLandmarkNode(
    SubcomponentsList children)
    :{}

AddressOverflowAndLandmarkNode::~AddressOverflowAndLandmarkNode() = default;

BetweenStreetsOrLandmarkNode::BetweenStreetsOrLandmarkNode(
    SubcomponentsList children)
    :{}

BetweenStreetsOrLandmarkNode::~BetweenStreetsOrLandmarkNode() = default;

AddressNode::AddressNode() :{}

AddressNode::AddressNode(const AddressNode& other) :{}

AddressNode& AddressNode::operator=(const AddressNode& other) {}

// Addresses are mergeable when all of their children are mergeable.
// Reformat the address from the children after merge if it changed.
AddressNode::AddressNode(SubcomponentsList children)
    :{}

AddressNode::~AddressNode() = default;

bool AddressNode::WipeInvalidStructure() {}

void AddressNode::MigrateLegacyStructure() {}

}  // namespace autofill