From 6ad29ba6df5b1705747f9292b4bcf9e0c91090a4 Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Wed, 22 Apr 2015 07:51:27 -0700 Subject: [PATCH] base: add new ChunkGenerator method to identify last chunk --- src/base/chunk_generator.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/base/chunk_generator.hh b/src/base/chunk_generator.hh index cf303f693..a11bd73e6 100644 --- a/src/base/chunk_generator.hh +++ b/src/base/chunk_generator.hh @@ -122,6 +122,12 @@ class ChunkGenerator */ bool done() const { return (curSize == 0); } + /** + * Is this the last chunk? + * @return True if yes, false if more to go. + */ + bool last() const { return (sizeLeft == 0); } + /** * Advance generator to next chunk. * @return True if successful, false if unsuccessful -- 2.30.2