From acdd946710862f03690c2d8cf52b803226784f67 Mon Sep 17 00:00:00 2001 From: karoljk Date: Tue, 15 Oct 2024 07:41:29 +0000 Subject: [PATCH] Rename NonGeographicalRegion to NonGeographicalEntity I renamed the NonGeographicalRegion variables and methodes to NonGeographicalEntity because we want to keep the naming the same so its easier to read. This CL is for the C++ version. --- cpp/src/phonenumbers/asyoutypeformatter.cc | 2 +- cpp/src/phonenumbers/phonenumberutil.cc | 10 +++++----- cpp/src/phonenumbers/phonenumberutil.h | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cpp/src/phonenumbers/asyoutypeformatter.cc b/cpp/src/phonenumbers/asyoutypeformatter.cc index 3fd323fa02..88648de54a 100644 --- a/cpp/src/phonenumbers/asyoutypeformatter.cc +++ b/cpp/src/phonenumbers/asyoutypeformatter.cc @@ -688,7 +688,7 @@ bool AsYouTypeFormatter::AttemptToExtractCountryCode() { phone_util_.GetRegionCodeForCountryCode(country_code, &new_region_code); if (PhoneNumberUtil::kRegionCodeForNonGeoEntity == new_region_code) { current_metadata_ = - phone_util_.GetMetadataForNonGeographicalRegion(country_code); + phone_util_.GetMetadataForNonGeographicalEntity(country_code); } else if (new_region_code != default_country_) { current_metadata_ = GetMetadataForRegion(new_region_code); } diff --git a/cpp/src/phonenumbers/phonenumberutil.cc b/cpp/src/phonenumbers/phonenumberutil.cc index d755806fce..3643a81d23 100644 --- a/cpp/src/phonenumbers/phonenumberutil.cc +++ b/cpp/src/phonenumbers/phonenumberutil.cc @@ -971,7 +971,7 @@ void PhoneNumberUtil::GetSupportedTypesForNonGeoEntity( std::set* types) const { DCHECK(types); const PhoneMetadata* metadata = - GetMetadataForNonGeographicalRegion(country_calling_code); + GetMetadataForNonGeographicalEntity(country_calling_code); if (metadata == NULL) { LOG(WARNING) << "Unknown country calling code for a non-geographical " << "entity provided: " @@ -1102,7 +1102,7 @@ const PhoneMetadata* PhoneNumberUtil::GetMetadataForRegion( return NULL; } -const PhoneMetadata* PhoneNumberUtil::GetMetadataForNonGeographicalRegion( +const PhoneMetadata* PhoneNumberUtil::GetMetadataForNonGeographicalEntity( int country_calling_code) const { absl::node_hash_map::const_iterator it = country_code_to_non_geographical_metadata_map_->find( @@ -1253,7 +1253,7 @@ void PhoneNumberUtil::FormatNationalNumberWithCarrierCode( const PhoneMetadata* PhoneNumberUtil::GetMetadataForRegionOrCallingCode( int country_calling_code, const std::string& region_code) const { return kRegionCodeForNonGeoEntity == region_code - ? GetMetadataForNonGeographicalRegion(country_calling_code) + ? GetMetadataForNonGeographicalEntity(country_calling_code) : GetMetadataForRegion(region_code); } @@ -2057,7 +2057,7 @@ bool PhoneNumberUtil::GetExampleNumberForType( it != global_network_calling_codes.end(); ++it) { int country_calling_code = *it; const PhoneMetadata* metadata = - GetMetadataForNonGeographicalRegion(country_calling_code); + GetMetadataForNonGeographicalEntity(country_calling_code); const PhoneNumberDesc* desc = GetNumberDescByType(*metadata, type); if (desc->has_example_number()) { ErrorType success = Parse(StrCat(kPlusSign, @@ -2080,7 +2080,7 @@ bool PhoneNumberUtil::GetExampleNumberForNonGeoEntity( int country_calling_code, PhoneNumber* number) const { DCHECK(number); const PhoneMetadata* metadata = - GetMetadataForNonGeographicalRegion(country_calling_code); + GetMetadataForNonGeographicalEntity(country_calling_code); if (metadata) { // For geographical entities, fixed-line data is always present. However, // for non-geographical entities, this is not the case, so we have to go diff --git a/cpp/src/phonenumbers/phonenumberutil.h b/cpp/src/phonenumbers/phonenumberutil.h index 7f7e744ea3..1bfd02cf87 100644 --- a/cpp/src/phonenumbers/phonenumberutil.h +++ b/cpp/src/phonenumbers/phonenumberutil.h @@ -859,6 +859,9 @@ class PhoneNumberUtil : public Singleton { const i18n::phonenumbers::PhoneMetadata* GetMetadataForNonGeographicalRegion( int country_calling_code) const; + const i18n::phonenumbers::PhoneMetadata* GetMetadataForNonGeographicalEntity( + int country_calling_code) const; + const i18n::phonenumbers::PhoneMetadata* GetMetadataForRegionOrCallingCode( int country_calling_code, const std::string& region_code) const;