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

Unified Diff: content/common/android/address_parser.h

Issue 10456007: [Android] Split the address parser from AddressDetector for WebView use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: transforming AddressParser into a namespace. Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/common/android/address_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/android/address_parser.h
diff --git a/content/common/android/address_parser.h b/content/common/android/address_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..aee9df704dfabe36de841b31752ff29ee50fd673
--- /dev/null
+++ b/content/common/android/address_parser.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_ADDRESS_PARSER_H_
+#define CONTENT_COMMON_ADDRESS_PARSER_H_
+#pragma once
+
+#include "base/string16.h"
+
+namespace content {
+
+// Provides methods to find a geographical address (currently US only)
+// in a given text string.
+namespace address_parser {
+
+// Find the first address in some chunk of text. If an address is found in
+// |text| true is returned and the address is copied into |address|.
+// Otherwise, false is returned.
+bool FindAddress(const string16& text, string16* address);
+
+// Find the first address in some chunk of test. |begin| is the starting
+// position to search from, |end| is the position to search to. |start_pos|
+// and |end_pos| are set to the starting and ending position of the address,
+// if found.
+bool FindAddress(const string16::const_iterator& begin,
+ const string16::const_iterator& end,
+ size_t* start_pos,
+ size_t* end_pos);
+
+} // namespace address_parser
+
+} // namespace content
+
+#endif // CONTENT_COMMON_ADDRESS_PARSER_H_
« no previous file with comments | « no previous file | content/common/android/address_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698