Skip to content

Commit 3b67d1f

Browse files
committed
Add comments
1 parent 6360242 commit 3b67d1f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cpp/src/phonenumbers/phonecontextparser.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
namespace i18n {
2828
namespace phonenumbers {
2929

30+
// Parses the phone-context parameter of a phone number in RFC3966 format.
3031
class PhoneContextParser {
3132
friend class PhoneNumberUtil;
3233
friend class PhoneContextParserTest;
@@ -45,6 +46,13 @@ class PhoneContextParser {
4546
std::shared_ptr<PhoneNumberRegExpsAndMappings> reg_exps,
4647
std::shared_ptr<PhoneNumberNormalizer> normalizer);
4748

49+
// Parses the phone-context parameter of a phone number in RFC3966 format.
50+
// If the phone-context parameter is not present, returns std::nullopt. If it
51+
// is present but invalid, returns an error status. If it is present and
52+
// valid, returns a PhoneContext object. This object contains the raw value of
53+
// the phone-context parameter. Additionally, if the phone-context is exactly
54+
// and only a + followed by a valid country code, it also contains the country
55+
// code.
4856
absl::StatusOr<std::optional<PhoneContextParser::PhoneContext>> Parse(
4957
absl::string_view phone_number);
5058

cpp/src/phonenumbers/phonenumbernormalizer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
namespace i18n {
2424
namespace phonenumbers {
2525

26+
// Util class to normalize phone numbers.
2627
class PhoneNumberNormalizer {
2728
friend class AsYouTypeFormatter;
2829
friend class PhoneContextParser;

0 commit comments

Comments
 (0)