/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
#include <config.h>
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
#include "lastfiles.h"
#include "debug.h"
#include <algorithm>
#include <iterator>
+
+using namespace lyx::support;
+
+using std::ifstream;
+using std::ofstream;
using std::getline;
using std::endl;
+using std::find;
+using std::copy;
+using std::ostream_iterator;
LastFiles::LastFiles(string const & filename, bool st, unsigned int num)
{
// we will not complain if we can't find filename nor will
// we issue a warning. (Lgb)
- std::ifstream ifs(filename.c_str());
+ ifstream ifs(filename.c_str());
string tmp;
FileInfo fileInfo;
void LastFiles::writeFile(string const & filename) const
{
- std::ofstream ofs(filename.c_str());
+ ofstream ofs(filename.c_str());
if (ofs) {
- std::copy(files.begin(), files.end(),
- std::ostream_iterator<string>(ofs, "\n"));
+ copy(files.begin(), files.end(),
+ ostream_iterator<string>(ofs, "\n"));
} else
lyxerr << "LyX: Warning: unable to save LastFiles: "
<< filename << endl;
void LastFiles::newFile(string const & file)
{
// If file already exist, delete it and reinsert at front.
- Files::iterator it = std::find(files.begin(), files.end(), file);
+ Files::iterator it = find(files.begin(), files.end(), file);
if (it != files.end())
files.erase(it);
files.push_front(file);