1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2001 The LyX Team.
8 * ======================================================
11 * \author Angus Leeming <a.leeming@ic.ac.uk>
14 #ifndef BIBLIOHELPERS_H
15 #define BIBLIOHELPERS_H
23 /** Functions of use to citation and bibtex GUI controllers and views */
41 /// First entry is the bibliography key, second the data
42 typedef std::map<string, string> InfoMap;
44 /// Returns a vector of bibliography keys
45 std::vector<string> const getKeys(InfoMap const &);
47 /** Returns the BibTeX data associated with a given key.
48 Empty if no info exists. */
49 string const getInfo(InfoMap const &, string const &);
51 /** Search a BibTeX info field for the given key and return the
53 string const parseBibTeX(string data, string const & findkey);
55 /** Returns an iterator to the first key that meets the search
56 criterion, or end() if unsuccessful.
59 the InfoMap of bibkeys info,
60 the vector of keys to be searched,
62 an iterator defining the starting point of the search,
63 an enum defining a Simple or Regex search,
64 an enum defining the search direction.
67 std::vector<string>::const_iterator
68 searchKeys(InfoMap const & map,
69 std::vector<string> const & keys_to_search,
70 string const & search_expression,
71 std::vector<string>::const_iterator start,
74 bool caseSensitive=false);
76 /** Do the dirty work for the search.
77 Should use through the function above */
78 std::vector<string>::const_iterator
79 simpleSearch(InfoMap const & map,
80 std::vector<string> const & keys_to_search,
81 string const & search_expression,
82 std::vector<string>::const_iterator start,
84 bool caseSensitive=false);
86 /// Should use through the function above
87 std::vector<string>::const_iterator
88 regexSearch(InfoMap const & map,
89 std::vector<string> const & keys_to_search,
90 string const & search_expression,
91 std::vector<string>::const_iterator start,
96 #endif // BIBLIOHELPERS_H