X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flastfiles.C;h=1691253373c4e486f1ec1b79ad81dbbfb15a2ea9;hb=f268743f8c014ef2dadd260fd1a3873cb1d2038b;hp=588a46d29c60e67b09e0a791fc82b01ec1990bfc;hpb=d1b90146494561edc89497bb1037efd6065f2c51;p=lyx.git diff --git a/src/lastfiles.C b/src/lastfiles.C index 588a46d29c..1691253373 100644 --- a/src/lastfiles.C +++ b/src/lastfiles.C @@ -1,29 +1,34 @@ -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2000 The LyX Team. +/** + * \file lastfiles.C + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * ====================================================== */ + * \author Lars Gullik Bjønnes + * + * Full author contact details are available in file CREDITS. + */ #include +#include "lastfiles.h" +#include "debug.h" -#ifdef __GNUG__ -#pragma implementation -#endif +#include "support/FileInfo.h" #include #include +#include -#include "support/FileInfo.h" -#include "lastfiles.h" -#include "debug.h" +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) @@ -51,11 +56,11 @@ void LastFiles::readFile(string const & filename) { // 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; - 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())) @@ -68,10 +73,10 @@ void LastFiles::readFile(string const & filename) 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(ofs, "\n")); + copy(files.begin(), files.end(), + ostream_iterator(ofs, "\n")); } else lyxerr << "LyX: Warning: unable to save LastFiles: " << filename << endl; @@ -81,7 +86,7 @@ void LastFiles::writeFile(string const & filename) const 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);