summaryrefslogtreecommitdiff
path: root/klm/util/file_piece.hh
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2010-12-13 16:18:34 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2010-12-13 16:18:34 -0500
commitbe98f29f51350c24136c191f01af3fbfe340ef78 (patch)
tree2e104152110ca76b527147458050a41934e031f2 /klm/util/file_piece.hh
parent063c0623aaf5dad8d02e5eae5793c123cd7fc3fe (diff)
new version of kenlm
Diffstat (limited to 'klm/util/file_piece.hh')
-rw-r--r--klm/util/file_piece.hh5
1 files changed, 5 insertions, 0 deletions
diff --git a/klm/util/file_piece.hh b/klm/util/file_piece.hh
index 11d4a751..b7697e71 100644
--- a/klm/util/file_piece.hh
+++ b/klm/util/file_piece.hh
@@ -68,6 +68,9 @@ class FilePiece {
StringPiece ReadLine(char delim = '\n') throw(GZException, EndOfFileException);
float ReadFloat() throw(GZException, EndOfFileException, ParseNumberException);
+ double ReadDouble() throw(GZException, EndOfFileException, ParseNumberException);
+ long int ReadLong() throw(GZException, EndOfFileException, ParseNumberException);
+ unsigned long int ReadULong() throw(GZException, EndOfFileException, ParseNumberException);
void SkipSpaces() throw (GZException, EndOfFileException);
@@ -80,6 +83,8 @@ class FilePiece {
private:
void Initialize(const char *name, std::ostream *show_progress, off_t min_buffer) throw(GZException);
+ template <class T> T ReadNumber() throw(GZException, EndOfFileException, ParseNumberException);
+
StringPiece Consume(const char *to) {
StringPiece ret(position_, to - position_);
position_ = to;