* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Herbert Voss
+ * \author Herbert Voß
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
#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