summaryrefslogtreecommitdiffstats
path: root/archive_reader.h
diff options
context:
space:
mode:
Diffstat (limited to 'archive_reader.h')
-rw-r--r--archive_reader.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/archive_reader.h b/archive_reader.h
index a867c0f..bbd5bcb 100644
--- a/archive_reader.h
+++ b/archive_reader.h
@@ -1,5 +1,5 @@
/* Tarlz - Archiver with multimember lzip compression
- Copyright (C) 2013-2020 Antonio Diaz Diaz.
+ Copyright (C) 2013-2021 Antonio Diaz Diaz.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@ struct Archive_descriptor
const int infd;
const Lzip_index lzip_index;
const bool seekable;
- const bool indexed;
+ const bool indexed; // archive is a compressed regular file
Archive_descriptor( const std::string & archive_name )
: name( archive_name ), namep( name.empty() ? "(stdin)" : name.c_str() ),
@@ -96,15 +96,15 @@ public:
*/
class Archive_reader_i : public Archive_reader_base // indexed reader
{
- long long data_pos_;
- long long mdata_end;
+ long long data_pos_; // current decompressed position
+ long long mdata_end_; // current member decompressed end
long long archive_pos; // current position in archive for pread
long member_id; // current member unless reading beyond
public:
Archive_reader_i( const Archive_descriptor & d )
: Archive_reader_base( d ),
- data_pos_( 0 ), mdata_end( 0 ), archive_pos( 0 ), member_id( 0 )
+ data_pos_( 0 ), mdata_end_( 0 ), archive_pos( 0 ), member_id( 0 )
{
decoder = LZ_decompress_open();
if( !decoder || LZ_decompress_errno( decoder ) != LZ_ok )
@@ -112,7 +112,8 @@ public:
}
long long data_pos() const { return data_pos_; }
- bool at_member_end() const { return data_pos_ == mdata_end; }
+ long long mdata_end() const { return mdata_end_; }
+ bool at_member_end() const { return data_pos_ == mdata_end_; }
// Resets decoder and sets position to the start of the member.
void set_member( const long i );