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