diff options
author | Kenneth Heafield <github@kheafield.com> | 2013-01-22 21:37:49 +0000 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2013-01-22 21:37:49 +0000 |
commit | b35a7f3a96ff8ae42e15922dd6949bf9f5d15501 (patch) | |
tree | 26edbe78931ffc50864a899c087d851005fe560b /klm/util/read_compressed.hh | |
parent | 51a412aa7f5f50035cf28a274a70508c839f3d40 (diff) |
KenLM 58da338b
Diffstat (limited to 'klm/util/read_compressed.hh')
-rw-r--r-- | klm/util/read_compressed.hh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/klm/util/read_compressed.hh b/klm/util/read_compressed.hh index 83ca9fb2..8b54c9e8 100644 --- a/klm/util/read_compressed.hh +++ b/klm/util/read_compressed.hh @@ -45,6 +45,10 @@ class ReadCompressed { // Takes ownership of fd. explicit ReadCompressed(int fd); + // Try to avoid using this. Use the fd instead. + // There is no decompression support for istreams. + explicit ReadCompressed(std::istream &in); + // Must call Reset later. ReadCompressed(); @@ -53,6 +57,9 @@ class ReadCompressed { // Takes ownership of fd. void Reset(int fd); + // Same advice as the constructor. + void Reset(std::istream &in); + std::size_t Read(void *to, std::size_t amount); uint64_t RawAmount() const { return raw_amount_; } |