2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2001 The LyX Team.
9 * ======================================================
12 * \author Angus Leeming <a.leeming@ic.ac.uk>
15 #ifndef BIBLIOHELPERS_H
16 #define BIBLIOHELPERS_H
24 /** Functions of use to citation and bibtex GUI controllers and views */
42 /// First entry is the bibliography key, second the data
43 typedef std::map<string, string> InfoMap;
45 /// Returns a vector of bibliography keys
46 std::vector<string> const getKeys(InfoMap const &);
48 /** Returns the BibTeX data associated with a given key.
49 Empty if no info exists. */
50 string const getInfo(InfoMap const &, string const &);
52 /** Search a BibTeX info field for the given key and return the
54 string const parseBibTeX(string data, string const & findkey);
56 /** Returns an iterator to the first key that meets the search
57 criterion, or end() if unsuccessful.
60 the InfoMap of bibkeys info,
61 the vector of keys to be searched,
63 an iterator defining the starting point of the search,
64 an enum defining a Simple or Regex search,
65 an enum defining the search direction.
68 std::vector<string>::const_iterator
69 searchKeys(InfoMap const & map,
70 std::vector<string> const & keys_to_search,
71 string const & search_expression,
72 std::vector<string>::const_iterator start,
75 bool caseSensitive=false);
77 /** Do the dirty work for the search.
78 Should use through the function above */
79 std::vector<string>::const_iterator
80 simpleSearch(InfoMap const & map,
81 std::vector<string> const & keys_to_search,
82 string const & search_expression,
83 std::vector<string>::const_iterator start,
85 bool caseSensitive=false);
87 /// Should use through the function above
88 std::vector<string>::const_iterator
89 regexSearch(InfoMap const & map,
90 std::vector<string> const & keys_to_search,
91 string const & search_expression,
92 std::vector<string>::const_iterator start,
97 #endif // BIBLIOHELPERS_H