Adding upstream version 1.18~pre2.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
cf6c2d1d59
commit
ed1b0d872f
18 changed files with 427 additions and 220 deletions
13
file_index.h
13
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; }
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue