Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: third_party/libaddressinput/chromium/cpp/src/address_data.cc

Issue 116363003: [rac] Validate an address. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Constify and remove .get() Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (C) 2013 Google Inc.
2 //
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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
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.
14
15 #include <libaddressinput/address_data.h>
16
17 #include <libaddressinput/address_field.h>
18
19 #include <cassert>
20 #include <string>
21
22 namespace i18n {
23 namespace addressinput {
24
25 const std::string& AddressData::GetField(AddressField field) const {
26 switch (field) {
27 case COUNTRY:
28 return country_code;
29 case ADMIN_AREA:
30 return administrative_area;
31 case LOCALITY:
32 return locality;
33 case DEPENDENT_LOCALITY:
34 return dependent_locality;
35 case SORTING_CODE:
36 return sorting_code;
37 case POSTAL_CODE:
38 return postal_code;
39 case ORGANIZATION:
40 return organization;
41 case RECIPIENT:
42 return recipient;
43 default:
44 assert(false);
45 return recipient;
46 }
47 }
48
49 } // namespace addressinput
50 } // namespace i18n
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698