summaryrefslogtreecommitdiffstats
path: root/file_index.h
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 11:53:09 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 11:53:09 +0000
commit746479a2d915d02f6f02ec508202afb1face7c2b (patch)
tree1d26867f949791b0e2ba99246aa252f02e693cef /file_index.h
parentAdding debian version 1.18~pre1-1. (diff)
downloadlziprecover-746479a2d915d02f6f02ec508202afb1face7c2b.tar.xz
lziprecover-746479a2d915d02f6f02ec508202afb1face7c2b.zip
Merging upstream version 1.18~pre2.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'file_index.h')
-rw-r--r--file_index.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/file_index.h b/file_index.h
index eff1157..5084fcb 100644
--- a/file_index.h
+++ b/file_index.h
@@ -20,10 +20,11 @@ class File_index
struct Member
{
Block dblock, mblock; // data block, member block
+ unsigned dictionary_size;
Member( const long long dp, const long long ds,
- const long long mp, const long long ms )
- : dblock( dp, ds ), mblock( mp, ms ) {}
+ const long long mp, const long long ms, const unsigned dict_size )
+ : dblock( dp, ds ), mblock( mp, ms ), dictionary_size( dict_size ) {}
bool operator==( const Member & m ) const { return ( mblock == m.mblock ); }
bool operator!=( const Member & m ) const { return ( mblock != m.mblock ); }
@@ -36,10 +37,10 @@ class File_index
void set_errno_error( const char * const msg );
void set_num_error( const char * const msg1, unsigned long long num,
- const char * const msg2 = "." );
+ const char * const msg2 = "" );
public:
- File_index() : error_( "No index." ), isize( 0 ), retval_( 2 ) {}
+ File_index() : error_( "No index" ), isize( 0 ), retval_( 2 ) {}
explicit File_index( const int infd );
File_index( const std::vector< int > & infd_vector, const long long fsize );
@@ -65,7 +66,7 @@ public:
{ if( member_vector.size() ) return member_vector.back().mblock.end();
else return 0; }
- // total size including trailing garbage (if any)
+ // total size including trailing data (if any)
long long file_size() const
{ if( isize >= 0 ) return isize; else return 0; }
@@ -73,4 +74,6 @@ public:
{ return member_vector[i].dblock; }
const Block & mblock( const long i ) const
{ return member_vector[i].mblock; }
+ unsigned dictionary_size( const long i ) const
+ { return member_vector[i].dictionary_size; }
};