2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>
4 * Distributed under the terms of the MIT License.
6 #ifndef _PACKAGE__HPKG__V1__PRIVATE__PACKAGE_READER_IMPL_H_
7 #define _PACKAGE__HPKG__V1__PRIVATE__PACKAGE_READER_IMPL_H_
10 #include <package/hpkg/v1/ReaderImplBase.h>
13 namespace BPackageKit
{
21 class BPackageEntryAttribute
;
27 class PackageReaderImpl
: public ReaderImplBase
{
28 typedef ReaderImplBase inherited
;
31 BErrorOutput
* errorOutput
);
34 status_t
Init(const char* fileName
);
35 status_t
Init(int fd
, bool keepFD
);
36 status_t
ParseContent(
37 BPackageContentHandler
* contentHandler
);
38 status_t
ParseContent(BLowLevelPackageContentHandler
*
41 int PackageFileFD() const;
43 uint64
HeapOffset() const;
44 uint64
HeapSize() const;
47 // from ReaderImplBase
48 virtual status_t
ReadAttributeValue(uint8 type
, uint8 encoding
,
49 AttributeValue
& _value
);
52 struct DataAttributeHandler
;
53 struct AttributeAttributeHandler
;
54 struct EntryAttributeHandler
;
55 struct RootAttributeHandler
;
58 status_t
_ParseTOC(AttributeHandlerContext
* context
,
59 AttributeHandler
* rootAttributeHandler
);
61 status_t
_GetTOCBuffer(size_t size
,
62 const void*& _buffer
);
68 SectionInfo fTOCSection
;
73 PackageReaderImpl::PackageFileFD() const
80 PackageReaderImpl::HeapOffset() const
87 PackageReaderImpl::HeapSize() const
93 } // namespace BPrivate
99 } // namespace BPackageKit
102 #endif // _PACKAGE__HPKG__V1__PRIVATE__PACKAGE_READER_IMPL_H_