OLD | NEW |
1 /** | 1 /** |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
3 * | 3 * |
4 * Licensed under the Apache License, Version 2.0 (the "License"); | 4 * Licensed under the Apache License, Version 2.0 (the "License"); |
5 * you may not use this file except in compliance with the License. | 5 * you may not use this file except in compliance with the License. |
6 * You may obtain a copy of the License at | 6 * You may obtain a copy of the License at |
7 * | 7 * |
8 * http://www.apache.org/licenses/LICENSE-2.0 | 8 * http://www.apache.org/licenses/LICENSE-2.0 |
9 * | 9 * |
10 * Unless required by applicable law or agreed to in writing, software | 10 * Unless required by applicable law or agreed to in writing, software |
11 * distributed under the License is distributed on an "AS IS" BASIS, | 11 * distributed under the License is distributed on an "AS IS" BASIS, |
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 * See the License for the specific language governing permissions and | 13 * See the License for the specific language governing permissions and |
14 * limitations under the License. | 14 * limitations under the License. |
15 */ | 15 */ |
16 | 16 |
17 // Author: Shawn Ligocki | 17 // Author: Shawn Ligocki |
18 | 18 |
19 #include "phonenumbers/utf/unilib.h" | 19 #include "phonenumbers/utf/unilib.h" |
20 | 20 |
21 #include "phonenumbers/base/basictypes.h" | 21 #include "phonenumbers/base/basictypes.h" |
22 #include "phonenumbers/utf/utf.h" | 22 #include "phonenumbers/utf/utf.h" |
23 | 23 |
| 24 namespace i18n { |
| 25 namespace phonenumbers { |
24 namespace UniLib { | 26 namespace UniLib { |
25 | 27 |
26 namespace { | 28 namespace { |
27 | 29 |
28 // MOE: start_strip | 30 // MOE: start_strip |
29 // MOE: end_strip | 31 // MOE: end_strip |
30 // Codepoints not allowed for interchange are: | 32 // Codepoints not allowed for interchange are: |
31 // C0 (ASCII) controls: U+0000 to U+001F excluding Space (SP, U+0020), | 33 // C0 (ASCII) controls: U+0000 to U+001F excluding Space (SP, U+0020), |
32 // Horizontal Tab (HT, U+0009), Line-Feed (LF, U+000A), | 34 // Horizontal Tab (HT, U+0009), Line-Feed (LF, U+000A), |
33 // Form Feed (FF, U+000C) and Carriage-Return (CR, U+000D) | 35 // Form Feed (FF, U+000C) and Carriage-Return (CR, U+000D) |
(...skipping 21 matching lines...) Expand all Loading... |
55 if ((rune == Runeerror && bytes_consumed == 1) || | 57 if ((rune == Runeerror && bytes_consumed == 1) || |
56 !IsInterchangeValidCodepoint(rune)) { | 58 !IsInterchangeValidCodepoint(rune)) { |
57 break; // Found | 59 break; // Found |
58 } | 60 } |
59 p += bytes_consumed; | 61 p += bytes_consumed; |
60 } | 62 } |
61 return p - begin; | 63 return p - begin; |
62 } | 64 } |
63 | 65 |
64 } // namespace UniLib | 66 } // namespace UniLib |
| 67 } // namespace phonenumbers |
| 68 } // namespace i18n |
OLD | NEW |