summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmarks/bookmark_title_match.h
blob: 334c66e9dbee22bcaf765be54aeb18f4fd37c8e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2013 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 CHROME_BROWSER_BOOKMARKS_BOOKMARK_TITLE_MATCH_H_
#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_TITLE_MATCH_H_

#include <stddef.h>

#include <utility>
#include <vector>

class BookmarkNode;

struct BookmarkTitleMatch {
  // Each MatchPosition is the [begin, end) positions of a match within a
  // string.
  typedef std::pair<size_t, size_t> MatchPosition;
  typedef std::vector<MatchPosition> MatchPositions;

  BookmarkTitleMatch();
  ~BookmarkTitleMatch();

  // The matching node of a query.
  const BookmarkNode* node;

  // Location of the matching words in the title of the node.
  MatchPositions match_positions;
};

#endif  // CHROME_BROWSER_BOOKMARKS_BOOKMARK_TITLE_MATCH_H_