using std::ifstream;
using std::ios;
+namespace {
+
// DO _NOT_ CHANGE _ANYTHING_ IN THIS TABLE
-static
unsigned long const crctab[256] =
{
0x0,
Return crc if successful, 0 if an error occurs. */
template<typename InputIterator>
-static inline
+inline
unsigned long do_crc(InputIterator first, InputIterator last)
{
unsigned long crc = 0;
return ~crc & 0xFFFFFFFF;
}
+} // namespace
+
// And this would be the file interface.
-unsigned long lyx::sum(char const * file)
+unsigned long lyx::sum(string const & file)
{
- ifstream ifs(file);
+ ifstream ifs(file.c_str());
if (!ifs) return 0;
ifs.unsetf(ios::skipws);
ostringstream ostr;
return do_crc(w.begin(), w.end());
}
-
-unsigned long lyx::sum(string const & file)
-{
- return lyx::sum(file.c_str());
-}