e85334022e
* 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.
57 lines
1.1 KiB
C++
57 lines
1.1 KiB
C++
/*
|
|
* Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _PACKAGE__HPKG__PRIVATE__REPOSITORY_READER_IMPL_H_
|
|
#define _PACKAGE__HPKG__PRIVATE__REPOSITORY_READER_IMPL_H_
|
|
|
|
|
|
#include <package/hpkg/ReaderImplBase.h>
|
|
|
|
#include <package/RepositoryInfo.h>
|
|
|
|
|
|
namespace BPackageKit {
|
|
|
|
namespace BHPKG {
|
|
|
|
|
|
class BRepositoryContentHandler;
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
|
|
class RepositoryReaderImpl : public ReaderImplBase {
|
|
typedef ReaderImplBase inherited;
|
|
public:
|
|
RepositoryReaderImpl(BErrorOutput* errorOutput);
|
|
~RepositoryReaderImpl();
|
|
|
|
status_t Init(const char* fileName);
|
|
status_t Init(int fd, bool keepFD);
|
|
|
|
status_t GetRepositoryInfo(
|
|
BRepositoryInfo* _repositoryInfo) const;
|
|
|
|
status_t ParseContent(
|
|
BRepositoryContentHandler* contentHandler);
|
|
|
|
private:
|
|
class PackagesAttributeHandler;
|
|
class PackageContentHandlerAdapter;
|
|
|
|
private:
|
|
BRepositoryInfo fRepositoryInfo;
|
|
};
|
|
|
|
|
|
} // namespace BPrivate
|
|
|
|
} // namespace BHPKG
|
|
|
|
} // namespace BPackageKit
|
|
|
|
|
|
#endif // _PACKAGE__HPKG__PRIVATE__REPOSITORY_READER_IMPL_H_
|