BPackageWriter::Recompress(): Change param to BPositionIO*

Besides that this is a nicer interface, it allows us to get a the HPKG
header as a side effect of initializing the reader, thus preventing
seeking backward in the file. This makes "package recompress - <file>"
work.
This commit is contained in:
Ingo Weinhold
2014-07-13 17:57:57 +02:00
parent 43a6b92c64
commit e1e6c12480
5 changed files with 34 additions and 31 deletions
+1 -5
View File
@@ -18,10 +18,6 @@ namespace BPackageKit {
namespace BHPKG {
class BPackageReader;
namespace BPrivate {
class PackageWriterImpl;
}
@@ -85,7 +81,7 @@ public:
status_t AddEntry(const char* fileName, int fd = -1);
status_t Finish();
status_t Recompress(BPackageReader* reader);
status_t Recompress(BPositionIO* inputFile);
// to be called after Init(); no Finish()
private:
@@ -35,7 +35,6 @@ class BPackageWriterParameters;
namespace BPrivate {
class PackageReaderImpl;
struct hpkg_header;
@@ -56,7 +55,7 @@ public:
status_t AddEntry(const char* fileName, int fd = -1);
status_t Finish();
status_t Recompress(PackageReaderImpl* reader);
status_t Recompress(BPositionIO* inputFile);
// to be called after Init(); no Finish()
private:
@@ -74,7 +73,7 @@ private:
const BPackageWriterParameters& parameters);
status_t _Finish();
status_t _Recompress(PackageReaderImpl* reader);
status_t _Recompress(BPositionIO* inputFile);
status_t _RegisterEntry(const char* fileName, int fd);
Entry* _RegisterEntry(Entry* parent,