]> git.lyx.org Git - lyx.git/blobdiff - src/lastfiles.C
fix typo that put too many include paths for most people
[lyx.git] / src / lastfiles.C
index a8832032788662107f74975e006467d13b4fe768..615b9de7ee35c8e52338e9dd516aca4369f6526d 100644 (file)
@@ -1,10 +1,10 @@
 /* This file is part of
- * ====================================================== 
- * 
+ * ======================================================
+ *
  *           LyX, The Document Processor
- *      
+ *
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-1999 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
 #pragma implementation
 #endif
 
+#include "lastfiles.h"
+#include "debug.h"
+
+#include "support/FileInfo.h"
+
 #include <fstream>
+#include <algorithm>
+#include <iterator>
+
+
 using std::ifstream;
 using std::ofstream;
-
-#include <algorithm>
+using std::getline;
+using std::endl;
 using std::find;
+using std::copy;
+using std::ostream_iterator;
 
-#include "support/FileInfo.h"
-#include "lastfiles.h"
-#include "debug.h"
 
 LastFiles::LastFiles(string const & filename, bool st, unsigned int num)
        : dostat(st)
@@ -55,7 +63,7 @@ void LastFiles::readFile(string const & filename)
        string tmp;
        FileInfo fileInfo;
 
-       while(getline(ifs, tmp) && files.size() < num_files) {
+       while (getline(ifs, tmp) && files.size() < num_files) {
                if (dostat) {
                        if (!(fileInfo.newFile(tmp).exist() &&
                              fileInfo.isRegular()))
@@ -70,23 +78,8 @@ void LastFiles::writeFile(string const & filename) const
 {
        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)
-               using std::copy;
-               using std::ostream_iterator;
                copy(files.begin(), files.end(),
                     ostream_iterator<string>(ofs, "\n"));
-#endif
        } else
                lyxerr << "LyX: Warning: unable to save LastFiles: "
                       << filename << endl;
@@ -105,7 +98,7 @@ void LastFiles::newFile(string const & file)
 }
 
 
-string LastFiles::operator[](unsigned int i) const
+string const LastFiles::operator[](unsigned int i) const
 {
        if (i < files.size())
                return files[i];