summaryrefslogtreecommitdiff
path: root/klm/util/file_piece.hh
diff options
context:
space:
mode:
authorKenneth Heafield <kheafiel@cluster10.lti.ece.cmu.local>2011-03-09 13:40:23 -0500
committerKenneth Heafield <kheafiel@cluster10.lti.ece.cmu.local>2011-03-09 13:40:23 -0500
commit6c923d45f2aaf960806429d36ca58a41b3a39740 (patch)
tree9d8c5bf26189e9e8e6c12c199a5925c5ca6046a9 /klm/util/file_piece.hh
parent95ea293005f74a627fdd2aae318d5746fa8c4e6c (diff)
kenlm sync
Diffstat (limited to 'klm/util/file_piece.hh')
-rw-r--r--klm/util/file_piece.hh17
1 files changed, 2 insertions, 15 deletions
diff --git a/klm/util/file_piece.hh b/klm/util/file_piece.hh
index f5249fcf..870ae5a3 100644
--- a/klm/util/file_piece.hh
+++ b/klm/util/file_piece.hh
@@ -3,6 +3,7 @@
#include "util/ersatz_progress.hh"
#include "util/exception.hh"
+#include "util/have.hh"
#include "util/mmap.hh"
#include "util/scoped.hh"
#include "util/string_piece.hh"
@@ -11,8 +12,6 @@
#include <cstddef>
-#define HAVE_ZLIB
-
namespace util {
class EndOfFileException : public Exception {
@@ -100,19 +99,7 @@ class FilePiece {
return ret;
}
- const char *FindDelimiterOrEOF(const bool *delim = kSpaces) throw (GZException, EndOfFileException) {
- for (const char *i = position_; i < position_end_; ++i) {
- if (delim[static_cast<unsigned char>(*i)]) return i;
- }
- while (!at_end_) {
- size_t skip = position_end_ - position_;
- Shift();
- for (const char *i = position_ + skip; i < position_end_; ++i) {
- if (delim[static_cast<unsigned char>(*i)]) return i;
- }
- }
- return position_end_;
- }
+ const char *FindDelimiterOrEOF(const bool *delim = kSpaces) throw (GZException, EndOfFileException);
void Shift() throw (EndOfFileException, GZException);
// Backends to Shift().