#include <algorithm>
#include <iterator>
-using lyx::support::absolutePath;
-using lyx::support::addName;
-using lyx::support::FileName;
-using lyx::support::package;
-
-using std::vector;
-using std::getline;
-using std::string;
-using std::ifstream;
-using std::ofstream;
-using std::istream;
-using std::ostream;
-using std::endl;
-using std::istringstream;
-using std::copy;
-using std::find;
-using std::ostream_iterator;
+using namespace std;
+using namespace lyx::support;
namespace {
namespace lyx {
+
LastFilesSection::LastFilesSection(unsigned int num) :
default_num_last_files(4),
absolute_max_last_files(100)
if (c == '[')
break;
getline(is, tmp);
- if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !absolutePath(tmp))
+ FileName const file(tmp);
+ if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !file.isAbsolute())
continue;
// read lastfiles
- FileName const file(tmp);
if (file.exists() && !file.isDirectory()
&& lastfiles.size() < num_lastfiles)
lastfiles.push_back(file);
if (c == '[')
break;
getline(is, tmp);
- if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !absolutePath(tmp))
+ FileName const file(tmp);
+ if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !file.isAbsolute())
continue;
- FileName const file(tmp);
if (file.exists() && !file.isDirectory())
lastopened.push_back(file);
else
itmp >> filepos.pos;
itmp.ignore(2); // ignore ", "
getline(itmp, fname);
- if (!absolutePath(fname))
- continue;
FileName const file(fname);
+ if (!file.isAbsolute())
+ continue;
if (file.exists() && !file.isDirectory()
&& lastfilepos.size() < num_lastfilepos)
lastfilepos[file] = filepos;
itmp >> pos;
itmp.ignore(2); // ignore ", "
getline(itmp, fname);
- if (!absolutePath(fname))
- continue;
FileName const file(fname);
+ if (!file.isAbsolute())
+ continue;
// only load valid bookmarks
if (file.exists() && !file.isDirectory() && idx <= max_bookmarks)
bookmarks[idx] = Bookmark(file, pit, pos, 0, 0);
}
} while (is.good());
// sort the toolbars by location, line and position
- std::sort(toolbars.begin(), toolbars.end());
+ sort(toolbars.begin(), toolbars.end());
}