mirror of
https://review.haiku-os.org/haiku
synced 2025-02-02 19:57:42 +01:00
0d6b3b20e1
* added class BPackageInfo, which contains packaging attributes of a package (the values relevant for package management) * implemented parser (mostly) for reading a BPackageInfo from a config file (.PackageInfo) in order to pass them on to the PackageWriter when creating a package * pulled hpkg-related stuff from bin/package into the package kit * adjusted packagefs-Volume to skip .PackageInfo files when populating the mountpoint, as those files shouldn't appear as part of an activated package git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40301 a95241bf-73f2-0310-859d-f6bbb57e9c96
67 lines
1.5 KiB
C++
67 lines
1.5 KiB
C++
/*
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef PACKAGE_DATA_H
|
|
#define PACKAGE_DATA_H
|
|
|
|
|
|
#include <package/hpkg/haiku_package.h>
|
|
|
|
|
|
namespace BPackageKit {
|
|
|
|
namespace BHaikuPackage {
|
|
|
|
namespace BPrivate {
|
|
|
|
|
|
class PackageData {
|
|
public:
|
|
PackageData();
|
|
|
|
uint64 CompressedSize() const
|
|
{ return fCompressedSize; }
|
|
uint64 UncompressedSize() const
|
|
{ return fUncompressedSize; }
|
|
uint64 Offset() const
|
|
{ return fEncodedInline ? 0 : fOffset; }
|
|
uint32 Compression() const { return fCompression; }
|
|
uint32 ChunkSize() const { return fChunkSize; }
|
|
|
|
bool IsEncodedInline() const
|
|
{ return fEncodedInline; }
|
|
const uint8* InlineData() const { return fInlineData; }
|
|
|
|
void SetData(uint64 size, uint64 offset);
|
|
void SetData(uint8 size, const void* data);
|
|
|
|
void SetCompression(uint32 compression)
|
|
{ fCompression = compression; }
|
|
void SetUncompressedSize(uint64 size)
|
|
{ fUncompressedSize = size; }
|
|
void SetChunkSize(uint32 size)
|
|
{ fChunkSize = size; }
|
|
|
|
private:
|
|
uint64 fCompressedSize;
|
|
uint64 fUncompressedSize;
|
|
union {
|
|
uint64 fOffset;
|
|
uint8 fInlineData[B_HPKG_MAX_INLINE_DATA_SIZE];
|
|
};
|
|
uint32 fChunkSize;
|
|
uint32 fCompression;
|
|
bool fEncodedInline;
|
|
};
|
|
|
|
|
|
} // namespace BPrivate
|
|
|
|
} // namespace BHaikuPackage
|
|
|
|
} // namespace BPackageKit
|
|
|
|
|
|
#endif // PACKAGE_DATA_H
|