diff options
author | philip.liard@gmail.com <philip.liard@gmail.com@ee073f10-1060-11df-b6a4-87a95322a99c> | 2013-05-03 13:49:35 +0000 |
---|---|---|
committer | philip.liard@gmail.com <philip.liard@gmail.com@ee073f10-1060-11df-b6a4-87a95322a99c> | 2013-05-03 13:49:35 +0000 |
commit | fa6ddeed736e42c266027a0d7b696909083d066b (patch) | |
tree | 03ddb871b8754439273acbf4ea88c7d05acc08af /phonenumberutil.h | |
parent | 96b80a3b937dfdd22d738ab9a71bfb10d5c5ad60 (diff) | |
download | phonenumbers-fa6ddeed736e42c266027a0d7b696909083d066b.tar.gz |
CPP: Make r570 compile in Chromium.
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/236272
R=jia.shao.peng@gmail.com
Review URL: https://codereview.appspot.com/9162043
git-svn-id: http://libphonenumber.googlecode.com/svn/trunk/cpp/src/phonenumbers@571 ee073f10-1060-11df-b6a4-87a95322a99c
Diffstat (limited to 'phonenumberutil.h')
-rw-r--r-- | phonenumberutil.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/phonenumberutil.h b/phonenumberutil.h index 1ba4ddf..528e584 100644 --- a/phonenumberutil.h +++ b/phonenumberutil.h @@ -59,13 +59,8 @@ class RegExp; // codes can be found here: // http://www.iso.org/iso/english_country_names_and_code_elements -#ifdef USE_GOOGLE_BASE -class PhoneNumberUtil { - friend struct DefaultSingletonTraits<PhoneNumberUtil>; -#else class PhoneNumberUtil : public Singleton<PhoneNumberUtil> { - friend class Singleton<PhoneNumberUtil>; -#endif + private: friend class AsYouTypeFormatter; friend class PhoneNumberMatcher; friend class PhoneNumberMatcherRegExps; @@ -74,6 +69,8 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> { friend class PhoneNumberUtilTest; friend class ShortNumberUtil; friend class ShortNumberUtilTest; + friend class Singleton<PhoneNumberUtil>; + public: ~PhoneNumberUtil(); static const char kRegionCodeForNonGeoEntity[]; @@ -172,9 +169,7 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> { // // The PhoneNumberUtil is implemented as a singleton. Therefore, calling // GetInstance multiple times will only result in one instance being created. -#ifdef USE_GOOGLE_BASE static PhoneNumberUtil* GetInstance(); -#endif // Returns true if the number is a valid vanity (alpha) number such as 800 // MICROSOFT. A valid vanity number will start with at least 3 digits and will @@ -552,9 +547,9 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> { MatchType IsNumberMatchWithOneString(const PhoneNumber& first_number, const string& second_number) const; - // Overrides the default logging system. The provided logger destruction is - // handled by this class (i.e don't delete it). - static void SetLogger(Logger* logger); + // Overrides the default logging system. This takes ownership of the provided + // logger. + void SetLogger(Logger* logger); // Gets an AsYouTypeFormatter for the specific region. // Returns an AsYouTypeFormatter object, which could be used to format phone |