diff --git a/cpp/src/phonenumbers/asyoutypeformatter.cc b/cpp/src/phonenumbers/asyoutypeformatter.cc index 3fd323fa0..88648de54 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 f1442974f..aa00e7bd9 100644 --- a/cpp/src/phonenumbers/phonenumberutil.cc +++ b/cpp/src/phonenumbers/phonenumberutil.cc @@ -974,7 +974,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: " @@ -1105,7 +1105,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( @@ -1257,7 +1257,7 @@ void PhoneNumberUtil::FormatNationalNumberWithCarrierCode( const PhoneMetadata* PhoneNumberUtil::GetMetadataForRegionOrCallingCode( int country_calling_code, const string& region_code) const { return kRegionCodeForNonGeoEntity == region_code - ? GetMetadataForNonGeographicalRegion(country_calling_code) + ? GetMetadataForNonGeographicalEntity(country_calling_code) : GetMetadataForRegion(region_code); } @@ -2067,7 +2067,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, @@ -2090,7 +2090,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 14cfc670c..ea6102507 100644 --- a/cpp/src/phonenumbers/phonenumberutil.h +++ b/cpp/src/phonenumbers/phonenumberutil.h @@ -865,6 +865,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 string& region_code) const;