Switch package file accessor classes to use BPositionIO

* PackageFileHeap{Reader,Writer} as well as Package{Reader,Writer} and
  their implementation and super classes do now internally use a
  BPositionIO instead of a FD to access the package file. This provides
  more flexibility needed for features to come.
* BPackageReader has already grown a new Init() version with a
  BPositionIO* parameter.
This commit is contained in:
Ingo Weinhold
2014-07-12 15:40:22 +02:00
parent 01e6d687c0
commit e527b79631
21 changed files with 205 additions and 141 deletions
+6 -1
View File
@@ -9,6 +9,9 @@
#include <SupportDefs.h>
class BPositionIO;
namespace BPackageKit {
namespace BHPKG {
@@ -34,12 +37,14 @@ public:
status_t Init(const char* fileName, uint32 flags = 0);
status_t Init(int fd, bool keepFD, uint32 flags = 0);
status_t Init(BPositionIO* file, bool keepFile,
uint32 flags = 0);
status_t ParseContent(
BPackageContentHandler* contentHandler);
status_t ParseContent(BLowLevelPackageContentHandler*
contentHandler);
int PackageFileFD();
BPositionIO* PackageFile() const;
BAbstractBufferedDataReader* HeapReader() const;
// Only valid as long as the reader lives.