]> git.lyx.org Git - lyx.git/blobdiff - src/DepTable.C
More 'standard conformant blurb' nonsense.
[lyx.git] / src / DepTable.C
index c148a7e8652d8b0bd924f68b921aea3926d74975..90849bb0d770ca7e2e5687a8abadcda0eab15609 100644 (file)
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "DepTable.h"
 #include "debug.h"
 
 #include "support/lyxlib.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
+#include "support/lyxtime.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -36,6 +33,8 @@
 using std::time;
 #endif
 
+using namespace lyx::support;
+
 using std::make_pair;
 using std::ofstream;
 using std::ifstream;
@@ -60,7 +59,7 @@ void DepTable::insert(string const & fi, bool upd)
                di.crc_prev = 0;
                if (upd) {
                        lyxerr[Debug::DEPEND] << " CRC..." << flush;
-                       di.crc_cur = lyx::sum(f);
+                       di.crc_cur = sum(f);
                        lyxerr[Debug::DEPEND] << "done." << endl;
                        struct stat f_info;
                        stat(fi.c_str(), &f_info);
@@ -79,7 +78,7 @@ void DepTable::insert(string const & fi, bool upd)
 void DepTable::update()
 {
        lyxerr[Debug::DEPEND] << "Updating DepTable..." << endl;
-       time_t start_time = time(0);
+       lyx::time_type const start_time = lyx::current_time();
 
        DepList::iterator itr = deplist.begin();
        while (itr != deplist.end()) {
@@ -93,7 +92,7 @@ void DepTable::update()
                        } else {
                                di.crc_prev = di.crc_cur;
                                lyxerr[Debug::DEPEND] << itr->first << " CRC... ";
-                               di.crc_cur = lyx::sum(itr->first);
+                               di.crc_cur = sum(itr->first);
                                lyxerr[Debug::DEPEND] << "done";
                        }
                } else {
@@ -114,7 +113,7 @@ void DepTable::update()
                }
                ++itr;
        }
-       time_t time_sec = time(0) - start_time;
+       lyx::time_type const time_sec = lyx::current_time() - start_time;
        lyxerr[Debug::DEPEND] << "Finished updating DepTable ("
                << time_sec << " sec)." << endl;
 }
@@ -237,7 +236,7 @@ void DepTable::write(string const & f) const
 }
 
 
-void DepTable::read(string const & f)
+bool DepTable::read(string const & f)
 {
        ifstream ifs(f.c_str());
        string nome;
@@ -255,4 +254,5 @@ void DepTable::read(string const & f)
                }
                deplist[nome] = di;
        }
+       return deplist.size();
 }