1 // Copyright (C) 2011 The Libphonenumber Authors
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 // Author: Philippe Liard
21 #include "phonenumbers/phonenumber.h"
24 namespace phonenumbers {
32 // Provides PhoneNumber comparison operators to support the use of EXPECT_EQ and
33 // EXPECT_NE in the unittests.
34 inline bool operator==(const PhoneNumber& number1, const PhoneNumber& number2) {
35 return ExactlySameAs(number1, number2);
38 inline bool operator!=(const PhoneNumber& number1, const PhoneNumber& number2) {
39 return !(number1 == number2);
42 // Needed by Google Test to display errors.
43 ostream& operator<<(ostream& os, const PhoneNumber& number);
45 ostream& operator<<(ostream& os, const vector<PhoneNumber>& numbers);
47 // Class containing string constants of region codes for easier testing. Note
48 // that another private RegionCode class is defined in
49 // cpp/src/phonenumbers/region_code.h. This one contains more constants.
52 static const char* AD() {
56 static const char* AO() {
60 static const char* AQ() {
64 static const char* AR() {
68 static const char* AU() {
72 static const char* BR() {
76 static const char* BS() {
80 static const char* CA() {
84 static const char* CN() {
88 static const char* CS() {
92 static const char* DE() {
96 static const char* GB() {
100 static const char* IT() {
104 static const char* JP() {
108 static const char* KR() {
112 static const char* MX() {
116 static const char* NZ() {
120 static const char* PL() {
124 static const char* RE() {
128 static const char* SG() {
132 static const char* UN001() {
136 static const char* US() {
140 static const char* YT() {
144 static const char* ZW() {
148 // Returns a region code string representing the "unknown" region.
149 static const char* GetUnknown() {
153 static const char* ZZ() {
158 } // namespace phonenumbers