Browse Source

Add comments

refactor-rfc-normalize-cpp
Silvio Brändle 11 months ago
parent
commit
3b67d1f005
2 changed files with 9 additions and 0 deletions
  1. +8
    -0
      cpp/src/phonenumbers/phonecontextparser.h
  2. +1
    -0
      cpp/src/phonenumbers/phonenumbernormalizer.h

+ 8
- 0
cpp/src/phonenumbers/phonecontextparser.h View File

@ -27,6 +27,7 @@
namespace i18n {
namespace phonenumbers {
// Parses the phone-context parameter of a phone number in RFC3966 format.
class PhoneContextParser {
friend class PhoneNumberUtil;
friend class PhoneContextParserTest;
@ -45,6 +46,13 @@ class PhoneContextParser {
std::shared_ptr<PhoneNumberRegExpsAndMappings> reg_exps,
std::shared_ptr<PhoneNumberNormalizer> normalizer);
// Parses the phone-context parameter of a phone number in RFC3966 format.
// If the phone-context parameter is not present, returns std::nullopt. If it
// is present but invalid, returns an error status. If it is present and
// valid, returns a PhoneContext object. This object contains the raw value of
// the phone-context parameter. Additionally, if the phone-context is exactly
// and only a + followed by a valid country code, it also contains the country
// code.
absl::StatusOr<std::optional<PhoneContextParser::PhoneContext>> Parse(
absl::string_view phone_number);


+ 1
- 0
cpp/src/phonenumbers/phonenumbernormalizer.h View File

@ -23,6 +23,7 @@
namespace i18n {
namespace phonenumbers {
// Util class to normalize phone numbers.
class PhoneNumberNormalizer {
friend class AsYouTypeFormatter;
friend class PhoneContextParser;


Loading…
Cancel
Save