Browse Source

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.
pull/3627/head
karoljk 1 year ago
parent
commit
be17f26001
3 changed files with 9 additions and 6 deletions
  1. +1
    -1
      cpp/src/phonenumbers/asyoutypeformatter.cc
  2. +5
    -5
      cpp/src/phonenumbers/phonenumberutil.cc
  3. +3
    -0
      cpp/src/phonenumbers/phonenumberutil.h

+ 1
- 1
cpp/src/phonenumbers/asyoutypeformatter.cc View File

@ -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);
}


+ 5
- 5
cpp/src/phonenumbers/phonenumberutil.cc View File

@ -974,7 +974,7 @@ void PhoneNumberUtil::GetSupportedTypesForNonGeoEntity(
std::set<PhoneNumberType>* 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<int, PhoneMetadata>::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


+ 3
- 0
cpp/src/phonenumbers/phonenumberutil.h View File

@ -865,6 +865,9 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
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;


Loading…
Cancel
Save