* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
#endif
#include <fstream>
-using std::ifstream;
-using std::ofstream;
-using std::copy;
-using std::ostream_iterator;
-
#include <algorithm>
-using std::find;
#include "support/FileInfo.h"
#include "lastfiles.h"
#include "debug.h"
+using std::getline;
+using std::endl;
+
+
LastFiles::LastFiles(string const & filename, bool st, unsigned int num)
: dostat(st)
{
{
// we will not complain if we can't find filename nor will
// we issue a warning. (Lgb)
- ifstream ifs(filename.c_str());
+ std::ifstream ifs(filename.c_str());
string tmp;
FileInfo fileInfo;
void LastFiles::writeFile(string const & filename) const
{
- ofstream ofs(filename.c_str());
+ std::ofstream ofs(filename.c_str());
if (ofs) {
-#if 0
- for (Files::const_iterator cit = files.begin();
- cit != files.end();
- ++cit) {
- ofs << (*cit) << '\n';
- }
-#else
- // Ok, ok. It is not required to do it this way...but it
- // is kindo nice and shows the versiality of iterators and
- // algorithms. I'll leave this in, and if I get reports
- // about compilations errors I take it out again before
- // 1.1.4. (Lgb)
- copy(files.begin(), files.end(),
- ostream_iterator<string>(ofs, "\n"));
-#endif
+ std::copy(files.begin(), files.end(),
+ std::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 = find(files.begin(), files.end(), file);
+ Files::iterator it = std::find(files.begin(), files.end(), file);
if (it != files.end())
files.erase(it);
files.push_front(file);
}
-string LastFiles::operator[](unsigned int i) const
+string const LastFiles::operator[](unsigned int i) const
{
if (i < files.size())
return files[i];