Skip to content

Commit

Permalink
Rename NonGeographicalRegion to NonGeographicalEntity
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
KarolJakubKrawiec committed Oct 15, 2024
1 parent 825a9e1 commit acdd946
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cpp/src/phonenumbers/asyoutypeformatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
10 changes: 5 additions & 5 deletions cpp/src/phonenumbers/phonenumberutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,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: "
Expand Down Expand Up @@ -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<int, PhoneMetadata>::const_iterator it =
country_code_to_non_geographical_metadata_map_->find(
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/phonenumbers/phonenumberutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,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 std::string& region_code) const;
Expand Down

0 comments on commit acdd946

Please sign in to comment.