OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This module computes snippets of queries based on hits in the documents | 5 // This module computes snippets of queries based on hits in the documents |
6 // for display in history search results. | 6 // for display in history search results. |
7 | 7 |
8 #ifndef CHROME_BROWSER_HISTORY_SNIPPET_H__ | 8 #ifndef CHROME_BROWSER_HISTORY_SNIPPET_H__ |
9 #define CHROME_BROWSER_HISTORY_SNIPPET_H__ | 9 #define CHROME_BROWSER_HISTORY_SNIPPET_H__ |
10 | 10 |
| 11 #include <string> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 class Snippet { | 14 class Snippet { |
14 public: | 15 public: |
15 // Each pair in MatchPositions is the [begin, end) positions of a match | 16 // Each pair in MatchPositions is the [begin, end) positions of a match |
16 // within a string. | 17 // within a string. |
17 typedef std::vector<std::pair<int, int> > MatchPositions; | 18 typedef std::vector<std::pair<int, int> > MatchPositions; |
18 | 19 |
19 // Parses an offsets string as returned from a sqlite full text index. An | 20 // Parses an offsets string as returned from a sqlite full text index. An |
20 // offsets string encodes information about why a row matched a text query. | 21 // offsets string encodes information about why a row matched a text query. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 private: | 59 private: |
59 // The text of the snippet. | 60 // The text of the snippet. |
60 std::wstring text_; | 61 std::wstring text_; |
61 | 62 |
62 // The matches within text_. | 63 // The matches within text_. |
63 MatchPositions matches_; | 64 MatchPositions matches_; |
64 }; | 65 }; |
65 | 66 |
66 #endif // CHROME_BROWSER_HISTORY_SNIPPET_H__ | 67 #endif // CHROME_BROWSER_HISTORY_SNIPPET_H__ |
67 | 68 |
OLD | NEW |