#include "components/autofill/core/browser/data_model/autofill_structured_address_utils.h"
#include <algorithm>
#include <string_view>
#include <utility>
#include "base/check.h"
#include "base/debug/alias.h"
#include "base/debug/dump_without_crashing.h"
#include "base/feature_list.h"
#include "base/i18n/case_conversion.h"
#include "base/i18n/char_iterator.h"
#include "base/no_destructor.h"
#include "base/strings/strcat.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversion_utils.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/data_model/autofill_profile_comparator.h"
#include "components/autofill/core/browser/data_model/autofill_structured_address_regex_provider.h"
#include "components/autofill/core/browser/data_model/borrowed_transliterator.h"
#include "components/autofill/core/common/autofill_features.h"
namespace autofill {
SortedTokenComparisonResult::SortedTokenComparisonResult(
SortedTokenComparisonStatus status,
std::vector<AddressToken> additional_tokens)
: … { … }
SortedTokenComparisonResult::SortedTokenComparisonResult(
SortedTokenComparisonResult&& other) = default;
SortedTokenComparisonResult& SortedTokenComparisonResult::operator=(
SortedTokenComparisonResult&& other) = default;
SortedTokenComparisonResult::~SortedTokenComparisonResult() = default;
bool SortedTokenComparisonResult::IsSingleTokenSubset() const { … }
bool SortedTokenComparisonResult::IsSingleTokenSuperset() const { … }
bool SortedTokenComparisonResult::OneIsSubset() const { … }
bool SortedTokenComparisonResult::ContainEachOther() const { … }
bool SortedTokenComparisonResult::TokensMatch() const { … }
Re2RegExCache::Re2RegExCache() = default;
Re2RegExCache* Re2RegExCache::Instance() { … }
const RE2* Re2RegExCache::GetRegEx(std::string_view pattern) { … }
std::unique_ptr<const RE2> BuildRegExFromPattern(std::string_view pattern) { … }
bool HasCjkNameCharacteristics(const std::string& name) { … }
bool HasMiddleNameInitialsCharacteristics(const std::string& middle_name) { … }
bool HasHispanicLatinxNameCharacteristics(const std::string& name) { … }
std::optional<base::flat_map<std::string, std::string>>
ParseValueByRegularExpression(const std::string& value,
const std::string& pattern) { … }
std::optional<base::flat_map<std::string, std::string>>
ParseValueByRegularExpression(const std::string& value, const RE2* regex) { … }
bool IsPartialMatch(const std::string& value, RegEx regex) { … }
bool IsPartialMatch(const std::string& value, const std::string& pattern) { … }
bool IsPartialMatch(const std::string& value, const RE2* expression) { … }
std::vector<std::string> GetAllPartialMatches(const std::string& value,
const std::string& pattern) { … }
std::vector<std::string> ExtractAllPlaceholders(const std::string& value) { … }
std::string GetPlaceholderToken(std::string_view value) { … }
std::string CaptureTypeWithPattern(
const FieldType& type,
std::initializer_list<std::string_view> pattern_span_initializer_list) { … }
std::string CaptureTypeWithPattern(
const FieldType& type,
std::initializer_list<std::string_view> pattern_span_initializer_list,
const CaptureOptions& options) { … }
std::string NoCapturePattern(const std::string& pattern,
const CaptureOptions& options) { … }
std::string CaptureTypeWithAffixedPattern(const FieldType& type,
const std::string& prefix,
const std::string& pattern,
const std::string& suffix,
const CaptureOptions& options) { … }
std::string CaptureTypeWithSuffixedPattern(const FieldType& type,
const std::string& pattern,
const std::string& suffix_pattern,
const CaptureOptions& options) { … }
std::string CaptureTypeWithPrefixedPattern(const FieldType& type,
const std::string& prefix_pattern,
const std::string& pattern,
const CaptureOptions& options) { … }
std::string CaptureTypeWithPattern(const FieldType& type,
const std::string& pattern,
CaptureOptions options) { … }
std::u16string NormalizeAndRewrite(const AddressCountryCode& country_code,
const std::u16string& text,
bool keep_white_space) { … }
std::u16string NormalizeValue(std::u16string_view value,
bool keep_white_space) { … }
bool AreStringTokenEquivalent(const std::u16string& one,
const std::u16string& other) { … }
bool AreStringTokenCompatible(const std::u16string& first,
const std::u16string& second) { … }
SortedTokenComparisonResult CompareSortedTokens(
const std::vector<AddressToken>& first,
const std::vector<AddressToken>& second) { … }
SortedTokenComparisonResult CompareSortedTokens(const std::u16string& first,
const std::u16string& second) { … }
bool AreSortedTokensEqual(const std::vector<AddressToken>& first,
const std::vector<AddressToken>& second) { … }
std::vector<AddressToken> TokenizeValue(const std::u16string value) { … }
}