Fix more class/struct mixups.
[haiku.git] / headers / os / package / hpkg / v1 / PackageContentHandler.h
blob1d700277d7362177d7aa74f539179fecb636e4be
1 /*
2 * Copyright 2009,2011, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _PACKAGE__HPKG__V1__PACKAGE_CONTENT_HANDLER_H_
6 #define _PACKAGE__HPKG__V1__PACKAGE_CONTENT_HANDLER_H_
9 #include <SupportDefs.h>
11 #include <package/hpkg/v1/HPKGDefs.h>
14 namespace BPackageKit {
16 namespace BHPKG {
19 struct BPackageInfoAttributeValue;
22 namespace V1 {
25 struct BPackageAttributeValue;
26 class BPackageEntry;
27 class BPackageEntryAttribute;
30 class BLowLevelPackageContentHandler {
31 public:
32 virtual ~BLowLevelPackageContentHandler();
34 virtual status_t HandleSectionStart(
35 BHPKGPackageSectionID sectionID,
36 bool& _handleSection) = 0;
37 virtual status_t HandleSectionEnd(
38 BHPKGPackageSectionID sectionID) = 0;
40 virtual status_t HandleAttribute(BHPKGAttributeID attributeID,
41 const BPackageAttributeValue& value,
42 void* parentToken, void*& _token) = 0;
43 virtual status_t HandleAttributeDone(
44 BHPKGAttributeID attributeID,
45 const BPackageAttributeValue& value,
46 void* parentToken, void* token) = 0;
48 virtual void HandleErrorOccurred() = 0;
50 protected:
51 static const char* AttributeNameForID(uint8 id);
55 class BPackageContentHandler {
56 public:
57 virtual ~BPackageContentHandler();
59 virtual status_t HandleEntry(BPackageEntry* entry) = 0;
60 virtual status_t HandleEntryAttribute(BPackageEntry* entry,
61 BPackageEntryAttribute* attribute) = 0;
62 virtual status_t HandleEntryDone(BPackageEntry* entry) = 0;
64 virtual status_t HandlePackageAttribute(
65 const BPackageInfoAttributeValue& value
66 ) = 0;
68 virtual void HandleErrorOccurred() = 0;
72 } // namespace V1
74 } // namespace BHPKG
76 } // namespace BPackageKit
79 #endif // _PACKAGE__HPKG__V1__PACKAGE_CONTENT_HANDLER_H_