diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 11:50:34 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 11:50:34 +0000 |
commit | 5a1def2b887dfc18a50032e8645df79a91ebeecd (patch) | |
tree | 7faff8fbc466cedf5707381d022e03ef13f2c489 /file_index.h | |
parent | Adding debian version 1.17~pre1-1. (diff) | |
download | lziprecover-5a1def2b887dfc18a50032e8645df79a91ebeecd.tar.xz lziprecover-5a1def2b887dfc18a50032e8645df79a91ebeecd.zip |
Merging upstream version 1.17~rc1.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'file_index.h')
-rw-r--r-- | file_index.h | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/file_index.h b/file_index.h index cf42d83..eff1157 100644 --- a/file_index.h +++ b/file_index.h @@ -1,5 +1,5 @@ /* Lziprecover - Data recovery tool for the lzip format - Copyright (C) 2009-2014 Antonio Diaz Diaz. + Copyright (C) 2009-2015 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 @@ -15,39 +15,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INT64_MAX -#define INT64_MAX 0x7FFFFFFFFFFFFFFFLL -#endif - - -class Block - { - long long pos_, size_; // pos + size <= INT64_MAX - -public: - Block( const long long p, const long long s ) : pos_( p ), size_( s ) {} - - long long pos() const { return pos_; } - long long size() const { return size_; } - long long end() const { return pos_ + size_; } - - void pos( const long long p ) { pos_ = p; } - void size( const long long s ) { size_ = s; } - - bool operator==( const Block & b ) const - { return pos_ == b.pos_ && size_ == b.size_; } - bool operator!=( const Block & b ) const - { return pos_ != b.pos_ || size_ != b.size_; } - - bool operator<( const Block & b ) const { return pos_ < b.pos_; } - - bool overlaps( const Block & b ) const - { return ( pos_ < b.end() && b.pos_ < end() ); } - void shift( Block & b ) { ++size_; ++b.pos_; --b.size_; } - Block split( const long long pos ); - }; - - class File_index { struct Member |