#include "ControlTexinfo.h"
#include "funcrequest.h"
+#include "support/filetools.h"
+
+#include <algorithm>
using std::string;
+using std::vector;
+
+namespace lyx {
+
+using support::onlyFilename;
+namespace frontend {
void getTexFileList(ControlTexinfo::texFileSuffix type,
- std::vector<string> & list)
+ std::vector<string> & list, bool withPath)
{
string filename;
switch (type) {
rescanTexStyles();
getTexFileList(filename, list);
}
+ if (withPath)
+ return;
+ vector<string>::iterator it = list.begin();
+ vector<string>::iterator end = list.end();
+ for (; it != end; ++it) {
+ *it = onlyFilename(*it);
+ }
+ // sort on filename only (no path)
+ std::sort(list.begin(), list.end());
}
{
return getListOfOptions(filename, "cls");
}
+
+
+string const ControlTexinfo::getFileType(ControlTexinfo::texFileSuffix type) const
+{
+ string ftype;
+ switch (type) {
+ case ControlTexinfo::bst:
+ ftype = "bst";
+ break;
+ case ControlTexinfo::cls:
+ ftype = "cls";
+ break;
+ case ControlTexinfo::sty:
+ ftype = "sty";
+ break;
+ }
+ return ftype;
+}
+
+} // namespace frontend
+} // namespace lyx