]> git.lyx.org Git - lyx.git/blobdiff - src/support/lyxsum.cpp
Revert qprocess code. Revisions reverted: 22026, 22030, 22044, 22048,
[lyx.git] / src / support / lyxsum.cpp
index b547b4ecbc1ae311c182a285d7724d30a9347f2e..781ca7f5591b1d8cfb9f8385f9201a425dee270c 100644 (file)
@@ -19,8 +19,7 @@
 #include <algorithm>
 #include <iomanip>
 
-using std::endl;
-using std::string;
+using namespace std;
 
 // OK, this is ugly, but it is the only workaround I found to compile
 // with gcc (any version) on a system which uses a non-GNU toolchain.
@@ -92,7 +91,6 @@ unsigned long sum(char const * file)
 #include <fstream>
 #include <iterator>
 
-
 namespace {
 
 template<typename InputIterator>
@@ -110,43 +108,26 @@ unsigned long do_crc(InputIterator first, InputIterator last)
 namespace lyx {
 namespace support {
 
-using std::ifstream;
-#if HAVE_DECL_ISTREAMBUF_ITERATOR
-using std::istreambuf_iterator;
 
 unsigned long sum(char const * file)
 {
-       //LYXERR(Debug::FILES, "lyx::sum() using istreambuf_iterator (fast)");
-
-       ifstream ifs(file, std::ios_base::in | std::ios_base::binary);
+       ifstream ifs(file, ios_base::in | ios_base::binary);
        if (!ifs)
                return 0;
 
+#if HAVE_DECL_ISTREAMBUF_ITERATOR
+       //LYXERR(Debug::FILES, "lyx::sum() using istreambuf_iterator (fast)");
        istreambuf_iterator<char> beg(ifs);
        istreambuf_iterator<char> end;
-
-       return do_crc(beg,end);
-}
 #else
-
-using std::istream_iterator;
-using std::ios;
-
-unsigned long sum(char const * file)
-{
        //LYXERR(Debug::FILES, "lyx::sum() using istream_iterator (slow as a snail)");
-
-       ifstream ifs(file, std::ios_base::in | std::ios_base::binary);
-       if (!ifs)
-               return 0;
-
        ifs.unsetf(ios::skipws);
        istream_iterator<char> beg(ifs);
        istream_iterator<char> end;
+#endif
 
        return do_crc(beg,end);
 }
-#endif
 
 } // namespace support
 } // namespace lyx