]> git.lyx.org Git - lyx.git/blobdiff - src/support/lyxsum.C
Fix small typos
[lyx.git] / src / support / lyxsum.C
index a0efb5d1b755847b1092c7260d5beeef90b33401..691ff2e71dfd45df1e1121573f30ae5325112bf0 100644 (file)
 
 #include <fstream>
 
-#if 0
-#ifdef HAVE_SSTREAM
-#include <sstream>
-using std::ostringstream;
-#else
-#include <strstream>
-#endif
-#else
 #include "Lsstream.h"
-#endif
 
 #include "support/lyxlib.h"
 
@@ -120,22 +111,16 @@ unsigned long lyx::sum(char const * file)
        ifstream ifs(file);
        if (!ifs) return 0;
        ifs.unsetf(ios::skipws);
-//#ifdef HAVE_SSTREAM
        ostringstream ostr;
        ostr << ifs.rdbuf();
        // The .c_str() is here in case we use our lyxstring class
        // instead of standard string. 
        string w = ostr.str().c_str();
        return do_crc(w.begin(), w.end());
-//#else
-//     ostrstream ostr;
-//     ostr << ifs.rdbuf();
-//     ostr << '\0';
-//     char * tmp = ostr.str();
-//     if (!tmp) return 0; // empty file
-//     string w(tmp, ostr.tellp());
-//     unsigned long crc = do_crc(w.begin(), w.end());
-//     delete tmp;
-//     return crc;
-//#endif
+}
+
+
+unsigned long lyx::sum(string const & file) 
+{
+       return lyx::sum(file.c_str());
 }