haiku/headers/os/package/hpkg/RepositoryWriter.h
Oliver Tappe 0d68f6afb3 Implemented repository writing:
* fleshed out RepositoryWriterImpl
* renamed BRepositoryHeader to BRepositoryInfo (in accordance with
  BPackageInfo)
* adjusted BRepositoryInfo to be able to parse itself from a
  driver_settings file
* added package_repo binary (only 'create' works as of yet)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40405 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-09 19:11:23 +00:00

72 lines
1.4 KiB
C++

/*
* Copyright 2011, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _PACKAGE__HPKG__REPOSITORY_WRITER_H_
#define _PACKAGE__HPKG__REPOSITORY_WRITER_H_
#include <package/hpkg/ErrorOutput.h>
class BEntry;
namespace BPackageKit {
class BPackageInfo;
class BRepositoryInfo;
namespace BHPKG {
namespace BPrivate {
class RepositoryWriterImpl;
}
using BPrivate::RepositoryWriterImpl;
class BRepositoryWriterListener : public BErrorOutput {
public:
virtual void PrintErrorVarArgs(const char* format,
va_list args) = 0;
virtual void OnPackageAdded(
const BPackageInfo& packageInfo) = 0;
virtual void OnPackageAttributesSizeInfo(uint32 stringCount,
uint32 uncompressedSize) = 0;
virtual void OnRepositorySizeInfo(uint32 headerSize,
uint32 repositoryInfoLength,
uint32 packageCount,
uint32 packageAttributesSize,
uint64 totalSize) = 0;
};
class BRepositoryWriter {
public:
public:
BRepositoryWriter(
BRepositoryWriterListener* listener,
const BRepositoryInfo* repositoryInfo);
~BRepositoryWriter();
status_t Init(const char* fileName);
status_t AddPackage(const BEntry& packageEntry);
status_t Finish();
private:
RepositoryWriterImpl* fImpl;
};
} // namespace BHPKG
} // namespace BPackageKit
#endif // _PACKAGE__HPKG__REPOSITORY_WRITER_H_