2 * \file ControlBibtex.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
10 * Full author contact details are available in file CREDITS.
15 #include "ControlBibtex.h"
18 #include "helper_funcs.h"
19 #include "tex_helpers.h"
22 #include "support/filetools.h"
24 using lyx::support::OnlyFilename;
31 ControlBibtex::ControlBibtex(Dialog & d)
32 : ControlCommand(d, "bibtex")
36 string const ControlBibtex::Browse(string const & in_name,
38 string const & pattern)
40 pair<string, string> dir1(_("Documents|#o#O"),
41 string(lyxrc.document_path));
42 return browseRelFile(in_name, kernel().bufferFilepath(),
43 title, pattern, false, dir1);
47 void ControlBibtex::getBibStyles(vector<string> & data) const
51 getTexFileList("bstFiles.lst", data);
52 // test, if we have a valid list, otherwise run rescan
55 getTexFileList("bstFiles.lst", data);
57 vector<string>::iterator it = data.begin();
58 vector<string>::iterator end = data.end();
59 for (; it != end; ++it) {
60 *it = OnlyFilename(*it);
65 void ControlBibtex::getBibFiles(vector<string> & data) const
69 getTexFileList("bibFiles.lst", data);
70 // test, if we have a valid list, otherwise run rescan
73 getTexFileList("bibFiles.lst", data);
75 vector<string>::iterator it = data.begin();
76 vector<string>::iterator end = data.end();
77 for (; it != end; ++it) {
78 *it = OnlyFilename(*it);
83 void ControlBibtex::rescanBibStyles() const