summaryrefslogtreecommitdiff
path: root/src/AdaptiveFileAllocationIterator.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-11-14 07:17:55 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-11-14 07:17:55 +0000
commit1372ac51ade17bc27126449bf29f99c6c2cf7703 (patch)
tree974a54b86b20555c8822f651c7b3a53c0a072df3 /src/AdaptiveFileAllocationIterator.cc
parent93e5dbed325f29c1bf867a2847d3b839d545cfb2 (diff)
2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added .cc file for classes/structs that only provided by header file. Defined non-POD classes' ctor, dtor in .cc file. Moved implementation code in header file to .cc file for major classes/strucsts.
Diffstat (limited to 'src/AdaptiveFileAllocationIterator.cc')
-rw-r--r--src/AdaptiveFileAllocationIterator.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/AdaptiveFileAllocationIterator.cc b/src/AdaptiveFileAllocationIterator.cc
index cd1fe1e5..347ae0df 100644
--- a/src/AdaptiveFileAllocationIterator.cc
+++ b/src/AdaptiveFileAllocationIterator.cc
@@ -34,13 +34,13 @@
/* copyright --> */
#include "AdaptiveFileAllocationIterator.h"
#include "BinaryStream.h"
-#ifdef HAVE_FALLOCATE
-# include "FallocFileAllocationIterator.h"
-#endif // HAVE_FALLOCATE
#include "SingleFileAllocationIterator.h"
#include "RecoverableException.h"
#include "LogFactory.h"
#include "Logger.h"
+#ifdef HAVE_FALLOCATE
+# include "FallocFileAllocationIterator.h"
+#endif // HAVE_FALLOCATE
namespace aria2 {
@@ -99,4 +99,18 @@ bool AdaptiveFileAllocationIterator::finished()
}
}
+off_t AdaptiveFileAllocationIterator::getCurrentLength()
+{
+ if(!allocator_) {
+ return offset_;
+ } else {
+ return allocator_->getCurrentLength();
+ }
+}
+
+uint64_t AdaptiveFileAllocationIterator::getTotalLength()
+{
+ return totalLength_;
+}
+
} // namespace aria2