haiku/headers/os/package/hpkg/RepositoryContentHandler.h
Ingo Weinhold e85334022e Repository file format: group attributes of a package
* Introduce new package attribute B_HPKG_ATTRIBUTE_ID_PACKAGE (valid
  only in a repository file) to group the attributes belonging to a
  package.
* BRepositoryContentHandler:
  - No longer derive from BPackageContentHandler.
  - Add hooks HandlePackage() and HandlePackageDone() that bracket the
    attributes for a package. This is more explicit and robust than
    handlers having to guess when one package ended and the next began.
* BRepositoryCache: Make use of BPackageInfoContentHandler. No need to
  duplicate the code for reading a package info from package info
  attributes.
2013-07-04 19:20:14 +02:00

50 lines
940 B
C++

/*
* Copyright 2011, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _PACKAGE__HPKG__REPOSITORY_CONTENT_HANDLER_H_
#define _PACKAGE__HPKG__REPOSITORY_CONTENT_HANDLER_H_
#include <SupportDefs.h>
#include <package/hpkg/HPKGDefs.h>
namespace BPackageKit {
class BRepositoryInfo;
namespace BHPKG {
class BPackageInfoAttributeValue;
class BRepositoryContentHandler {
public:
virtual ~BRepositoryContentHandler();
virtual status_t HandleRepositoryInfo(
const BRepositoryInfo& info) = 0;
virtual status_t HandlePackage(const char* packageName) = 0;
virtual status_t HandlePackageAttribute(
const BPackageInfoAttributeValue& value)
= 0;
virtual status_t HandlePackageDone(const char* packageName) = 0;
virtual void HandleErrorOccurred() = 0;
};
} // namespace BHPKG
} // namespace BPackageKit
#endif // _PACKAGE__HPKG__REPOSITORY_CONTENT_HANDLER_H_