cpp/src/phonenumbers/phonenumberutil.cc
// Returns the types we have metadata for based on the PhoneMetadata object
// passed in.
Returns the types we have metadata for based on the PhoneMetadata object
passed in.
Returns the types we have metadata for based on the PhoneMetadata object passed in .
void GetSupportedTypesForMetadata(
    const PhoneMetadata& metadata,
    std::set<PhoneNumberUtil::PhoneNumberType>* types) {
  DCHECK(types);
  for (int i = 0; i <= static_cast<int>(PhoneNumberUtil::kMaxNumberType); ++i) {
    PhoneNumberUtil::PhoneNumberType type =
        static_cast<PhoneNumberUtil::PhoneNumberType>(i);
    if (type == PhoneNumberUtil::FIXED_LINE_OR_MOBILE ||
        type == PhoneNumberUtil::UNKNOWN) {
      continue;
    }
    if (DescHasData(*GetNumberDescByType(metadata, type))) {
      types->insert(type);
    }
  }
}
void GetSupportedTypesForMetadata ( const PhoneMetadata & metadata , std :: set < PhoneNumberUtil :: PhoneNumberType > * types ) { DCHECK ( types ) ; for ( int i = 0 ; i <= static_cast < int > ( PhoneNumberUtil :: kMaxNumberType ) ; ++ i ) { PhoneNumberUtil :: PhoneNumberType type = static_cast < PhoneNumberUtil :: PhoneNumberType > ( i ) ; if ( type == PhoneNumberUtil :: FIXED_LINE_OR_MOBILE || type == PhoneNumberUtil :: UNKNOWN ) { continue ; } if ( DescHasData ( * GetNumberDescByType ( metadata , type ) ) ) { types -> insert ( type ) ; } } }
Returns the types we have metadata for based on the PhoneMetadata object
passed in.
Returns the types we have metadata for based on the PhoneMetadata object passed in .
// Never return FIXED_LINE_OR_MOBILE (it is a convenience type, and // represents that a particular number type can't be // determined) or UNKNOWN (the non-type).