X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flastfiles.C;h=615b9de7ee35c8e52338e9dd516aca4369f6526d;hb=98c966c64594611e469313314abd1e59524adb4a;hp=588a46d29c60e67b09e0a791fc82b01ec1990bfc;hpb=d1b90146494561edc89497bb1037efd6065f2c51;p=lyx.git diff --git a/src/lastfiles.C b/src/lastfiles.C index 588a46d29c..615b9de7ee 100644 --- a/src/lastfiles.C +++ b/src/lastfiles.C @@ -1,10 +1,10 @@ /* This file is part of - * ====================================================== - * + * ====================================================== + * * LyX, The Document Processor - * + * * Copyright 1995 Matthias Ettrich - * Copyright 1995-2000 The LyX Team. + * Copyright 1995-2001 The LyX Team. * * ====================================================== */ @@ -15,15 +15,23 @@ #pragma implementation #endif +#include "lastfiles.h" +#include "debug.h" + +#include "support/FileInfo.h" + #include #include +#include -#include "support/FileInfo.h" -#include "lastfiles.h" -#include "debug.h" +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 +59,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 +76,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 +89,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);