summaryrefslogtreecommitdiffstats
path: root/file_index.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2017-05-07 15:55:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2017-05-07 15:55:05 +0000
commit6b876fb72fd61b2d0a2265c6f6394569bdca3a18 (patch)
treef9bbba110ba3a8692d8072b483bd7baf8d6d5079 /file_index.h
parentReleasing debian version 1.5-5. (diff)
downloadplzip-6b876fb72fd61b2d0a2265c6f6394569bdca3a18.tar.xz
plzip-6b876fb72fd61b2d0a2265c6f6394569bdca3a18.zip
Merging upstream version 1.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'file_index.h')
-rw-r--r--file_index.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/file_index.h b/file_index.h
index 8345796..5b9813e 100644
--- a/file_index.h
+++ b/file_index.h
@@ -1,5 +1,5 @@
/* Plzip - Parallel compressor compatible with lzip
- Copyright (C) 2009-2016 Antonio Diaz Diaz.
+ Copyright (C) 2009-2017 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
@@ -50,26 +50,31 @@ class File_index
std::vector< Member > member_vector;
std::string error_;
+ const long long isize;
int retval_;
void set_errno_error( const char * const msg );
- void set_num_error( const char * const msg1, unsigned long long num,
- const char * const msg2 = "" );
+ void set_num_error( const char * const msg, unsigned long long num );
+ bool skip_trailing_data( const int fd, long long & pos );
public:
- File_index( const int infd, const bool ignore_garbage );
+ File_index( const int infd, const bool ignore_trailing );
long members() const { return member_vector.size(); }
const std::string & error() const { return error_; }
int retval() const { return retval_; }
- long long data_end() const
- { if( member_vector.size() ) return member_vector.back().dblock.end();
- else return 0; }
+ long long udata_size() const
+ { if( member_vector.empty() ) return 0;
+ return member_vector.back().dblock.end(); }
- long long file_end() const
- { if( member_vector.size() ) return member_vector.back().mblock.end();
- else return 0; }
+ long long cdata_size() const
+ { if( member_vector.empty() ) return 0;
+ return member_vector.back().mblock.end(); }
+
+ // total size including trailing data (if any)
+ long long file_size() const
+ { if( isize >= 0 ) return isize; else return 0; }
const Block & dblock( const long i ) const
{ return member_vector[i].dblock; }