* Update lock_posix.h
Remove uses of the deprecated DISALLOW_COPY_AND_ASSIGN in favor of explicitly deleted constructors and assignment operators.
* Remove uses of the deprecated DISALLOW_COPY_AND_ASSIGN in favor of explicitly deleted constructors and assignment operators.
* Add check for `phone-context`.
Add a check to PhoneNumberUtil that the value of the `phone-context` parameter of the tel URI follows the correct syntax as defined in [RFC3966](https://www.rfc-editor.org/rfc/rfc3966#section-3).
* Add check for `phone-context`.
Add a check to PhoneNumberUtil that the value of the `phone-context` parameter of the tel URI follows the correct syntax as defined in [RFC3966](https://www.rfc-editor.org/rfc/rfc3966#section-3).
* Add check for `phone-context`.
Add a check to PhoneNumberUtil that the value of the `phone-context` parameter of the tel URI follows the correct syntax as defined in [RFC3966](https://www.rfc-editor.org/rfc/rfc3966#section-3).
- Faced link errors stemmed from mismatch of api definitions of absl::node_hash_set. So explicitly mentioned this lib as dependency during linking. This is common case/solution for absl hash set lib's link errors as per community.
- Decided to continued to have wrapper (stringutil), so that in future it's easy if we decided to change implementation; client code is safe. Changed most of the implementations & data structures in stringutil, to use abseil stuffs more.
- Though absl::string_view is suitable for most cases where we want immutable/read-only string structures, limiting to stringutil apis, not changing public API signatures (even though no compliance issue); reason: reduce dependency on abseil libs.
- Abseil specific changes done:
- std::set => absl::node_hash_set
- std::map => absl::node_hash_map
- Using absl alternatives for “SplitStringUsing” API and “StringHolder” class impl.
- Replaced manual impl of prefix and suffix checks with absl::StartsWith() and absl::EndsWith.
- Similarly used absl::StrReplaceAll, absl::StrCat, absl::StrAppend where possible; and for type conversion apis.
- Note: Tried applying parameter packs to replace manually written duplicate ```StrCat``` apis (for accommodating more number of parameters of same type), but it did not go well when different type arguments passed. Eg char, int types to be converted to StringHolder; faced constructor implicit conversion issues.
The format of the data has changed such that formatting patterns now only refer to \d, not specific numbers, so we don't need the special handling in the AYTF code which converts them to \d.
* It was confusing and unnecessary. Not every country that has short numbers beginning with a 0 had it, and it is not the only digit that could overlap with a national prefix and hence be interpreted incorrectly.
* Make canBeInternationallyDialled_API public in Java and CPP
* update notes in pending_code_changes.txt
* Remove TODO on canBeInternationallyDialled as it is already an public API in JS
* Make JS canBeInternationallyDialled API doc consistent with Java and CPP
Update doc references to refer to CLDR and the page of CLDR codes where
appropriate - it used to say ISO country codes were used, but they aren't.
Also updated to refer to two *or three* letter language codes since they may be three letters (we use the shortest defined one for a language)
Updating comments about leadingDigits field at territory level as well.
Making function IsNumberGeographical public. This function operates on
the type of number and the country it belongs to only, so may have some
false positives.
Using this in the geocoder so that geocoding now limited to numbers that
we consider geographical, based on their type and country, rather than
just based on their type. The C++ geocoder did not previously check the
number type/country at all.
Indonesian and Chinese mobile numbers have now been added to the list of
possibly-geographical numbers.
* New useful getExampleNumber methods (for testing) - one for invalid
numbers and one for getting a number of a particular type without
specifying a country.
This CL ensures that:
- All declarations in headers are made in the i18n::phonenumbers namespace.
- All USE flags/macros are prefixed with I18N_PHONENUMBERS_ to avoid name
clashes.
- All the code in base/ is actually used (by deleting unused code).
- Outdated occurrences of USE_GOOGLE_BASE don't exist anymore.
- Logging in PhoneNumberUtil is disabled by default (in production). However it
can be enabled by calling PhoneNumberUtil::SetLogger() as it is now done
during testing.
BUG=http://crbug.com/236272R=jia.shao.peng@gmail.com
Review URL: https://codereview.appspot.com/9162043
Note that the metadata files were not uploaded to appspot because they were too
large. Here is the list of the files affected by this change (generated by
Git):
cpp/src/phonenumbers/lite_metadata.cc
cpp/src/phonenumbers/logger.h
cpp/src/phonenumbers/metadata.cc
cpp/src/phonenumbers/phonenumbermatcher.cc
cpp/src/phonenumbers/phonenumberutil.cc
cpp/src/phonenumbers/phonenumberutil.h
cpp/src/phonenumbers/region_code.h
cpp/src/phonenumbers/stringutil.cc
cpp/src/phonenumbers/stringutil.h
cpp/test/phonenumbers/asyoutypeformatter_test.cc
cpp/test/phonenumbers/phonenumbermatcher_test.cc
cpp/test/phonenumbers/phonenumberutil_test.cc
cpp/test/phonenumbers/stringutil_test.cc
This CL also fixes the issue reported by Aaron about the logger being invoked
before it is initialized.
Review URL: https://codereview.appspot.com/5786065