OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ANDROID_WEBVIEW_NATIVE_ADDRESS_PARSER_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_ADDRESS_PARSER_H_ |
6 #define ANDROID_WEBVIEW_NATIVE_ADDRESS_PARSER_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_ADDRESS_PARSER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 | 11 |
12 namespace android_webview { | 12 namespace android_webview { |
13 | 13 |
14 // Provides methods to find a geographical address (currently US only) | 14 // Provides methods to find a geographical address (currently US only) |
15 // in a given text string. | 15 // in a given text string. |
16 namespace address_parser { | 16 namespace address_parser { |
17 | 17 |
18 // Find the first address in some chunk of text. If an address is found in | 18 // Find the first address in some chunk of text. If an address is found in |
19 // |text| true is returned and the address is copied into |address|. | 19 // |text| true is returned and the address is copied into |address|. |
20 // Otherwise, false is returned. | 20 // Otherwise, false is returned. |
21 bool FindAddress(const base::string16& text, base::string16* address); | 21 bool FindAddress(const base::string16& text, base::string16* address); |
22 | 22 |
23 // Find the first address in some chunk of test. |begin| is the starting | 23 // Find the first address in some chunk of test. |begin| is the starting |
24 // position to search from, |end| is the position to search to. |start_pos| | 24 // position to search from, |end| is the position to search to. |start_pos| |
25 // and |end_pos| are set to the starting and ending position of the address, | 25 // and |end_pos| are set to the starting and ending position of the address, |
26 // if found. | 26 // if found. |
27 bool FindAddress(const base::string16::const_iterator& begin, | 27 bool FindAddress(const base::string16::const_iterator& begin, |
28 const base::string16::const_iterator& end, | 28 const base::string16::const_iterator& end, |
29 size_t* start_pos, | 29 size_t* start_pos, |
30 size_t* end_pos); | 30 size_t* end_pos); |
31 | 31 |
32 } // namespace address_parser | 32 } // namespace address_parser |
33 | 33 |
34 } // namespace android_webview | 34 } // namespace android_webview |
35 | 35 |
36 #endif // ANDROID_WEBVIEW_NATIVE_ADDRESS_PARSER_H_ | 36 #endif // ANDROID_WEBVIEW_BROWSER_ADDRESS_PARSER_H_ |
OLD | NEW |