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
20 #include "phonenumbers/phonenumber.pb.h"
21 #include "phonenumbers/test_util.h"
27 namespace phonenumbers {
29 ostream& operator<<(ostream& os, const PhoneNumber& number) {
31 << "country_code: " << number.country_code() << endl
32 << "national_number: " << number.national_number() << endl;
33 if (number.has_extension()) {
34 os << "extension: " << number.extension() << endl;
36 if (number.has_italian_leading_zero()) {
37 os << "italian_leading_zero: " << number.italian_leading_zero() << endl;
39 if (number.has_raw_input()) {
40 os << "raw_input: " << number.raw_input() << endl;
42 if (number.has_country_code_source()) {
43 os << "country_code_source: " << number.country_code_source() << endl;
45 if (number.has_preferred_domestic_carrier_code()) {
46 os << "preferred_domestic_carrier_code: "
47 << number.preferred_domestic_carrier_code() << endl;
52 ostream& operator<<(ostream& os, const vector<PhoneNumber>& numbers) {
54 for (vector<PhoneNumber>::const_iterator it = numbers.begin();
55 it != numbers.end(); ++it) {
58 os << endl << "]" << endl;
62 } // namespace phonenumbers