]> git.lyx.org Git - lyx.git/blobdiff - src/lastfiles.C
More fixes to insettabular/text (and some missing features added).
[lyx.git] / src / lastfiles.C
index 6497f8998ec51deaef11072e8880b980d539c722..d53206221975b11dcc12033aadf5c5eb1f449669 100644 (file)
@@ -1,12 +1,12 @@
 /* This file is part of
- * ======================================================
+ * ====================================================== 
  * 
  *           LyX, The Document Processor
  *      
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-1999 The LyX Team.
+ *           Copyright 1995-2000 The LyX Team.
  *
- * ======================================================*/
+ * ====================================================== */
 
 #include <config.h>
 
 #endif
 
 #include <fstream>
-using std::ifstream;
-using std::ofstream;
-
 #include <algorithm>
-using std::find;
 
 #include "support/FileInfo.h"
 #include "lastfiles.h"
 #include "debug.h"
 
+using std::ifstream;
+using std::getline;
+using std::ofstream;
+using std::copy;
+using std::ostream_iterator;
+using std::find;
+using std::endl;
+
 LastFiles::LastFiles(string const & filename, bool st, unsigned int num)
        : dostat(st)
 {
@@ -70,11 +74,8 @@ void LastFiles::writeFile(string const & filename) const
 {
        ofstream ofs(filename.c_str());
        if (ofs) {
-               for (Files::const_iterator cit = files.begin();
-                    cit != files.end();
-                    ++cit) {
-                       ofs << (*cit) << '\n';
-               }
+               copy(files.begin(), files.end(),
+                    ostream_iterator<string>(ofs, "\n"));
        } else
                lyxerr << "LyX: Warning: unable to save LastFiles: "
                       << filename << endl;
@@ -93,7 +94,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];