Revert "Move ZlibDecompressor to libshared"
This reverts commit 9af2105d36.
Conflicts:
src/kits/package/Jamfile
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#define _PACKAGE__HPKG__PRIVATE__DATA_WRITERS_H_
|
||||
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
#include <package/hpkg/ZlibCompressor.h>
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class ZlibDataWriter : public AbstractDataWriter, private BDataIO {
|
||||
class ZlibDataWriter : public AbstractDataWriter, private BDataOutput {
|
||||
public:
|
||||
ZlibDataWriter(AbstractDataWriter* dataWriter);
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
private:
|
||||
// BDataOutput
|
||||
virtual status_t Write(const void* buffer, size_t size);
|
||||
virtual status_t WriteData(const void* buffer, size_t size);
|
||||
|
||||
private:
|
||||
AbstractDataWriter* fDataWriter;
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
|
||||
// BAbstractBufferedDataReader
|
||||
virtual status_t ReadDataToOutput(off_t offset, size_t size,
|
||||
BDataIO* output);
|
||||
BDataOutput* output);
|
||||
|
||||
public:
|
||||
static const size_t kChunkSize = 64 * 1024;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <package/hpkg/HPKGDefsPrivate.h>
|
||||
|
||||
#include <package/hpkg/BufferDataOutput.h>
|
||||
#include <package/hpkg/DataOutput.h>
|
||||
#include <package/hpkg/DataWriters.h>
|
||||
#include <package/hpkg/PackageWriter.h>
|
||||
#include <package/hpkg/Strings.h>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _PACKAGE__HPKG__PRIVATE__ZLIB_COMPRESSION_BASE_H_
|
||||
#define _PACKAGE__HPKG__PRIVATE__ZLIB_COMPRESSION_BASE_H_
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
namespace BHPKG {
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
class ZlibCompressionBase {
|
||||
public:
|
||||
static status_t TranslateZlibError(int error);
|
||||
};
|
||||
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
} // namespace BHPKG
|
||||
|
||||
} // namespace BPackageKit
|
||||
|
||||
|
||||
#endif // _PACKAGE__HPKG__PRIVATE__ZLIB_COMPRESSION_BASE_H_
|
||||
@@ -8,10 +8,7 @@
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
#include <ZlibCompressionBase.h>
|
||||
|
||||
|
||||
class BDataIO;
|
||||
#include <package/hpkg/ZlibCompressionBase.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
@@ -19,12 +16,15 @@ namespace BPackageKit {
|
||||
namespace BHPKG {
|
||||
|
||||
|
||||
class BDataOutput;
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
class ZlibCompressor : public ::BPrivate::ZlibCompressionBase {
|
||||
class ZlibCompressor : public ZlibCompressionBase {
|
||||
public:
|
||||
ZlibCompressor(BDataIO* output);
|
||||
ZlibCompressor(BDataOutput* output);
|
||||
~ZlibCompressor();
|
||||
|
||||
status_t Init(int compressionLevel = Z_BEST_COMPRESSION);
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
|
||||
private:
|
||||
z_stream fStream;
|
||||
BDataIO* fOutput;
|
||||
BDataOutput* fOutput;
|
||||
bool fStreamInitialized;
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _PACKAGE__HPKG__PRIVATE__ZLIB_DECOMPRESSOR_H_
|
||||
#define _PACKAGE__HPKG__PRIVATE__ZLIB_DECOMPRESSOR_H_
|
||||
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
#include <package/hpkg/ZlibCompressionBase.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
namespace BHPKG {
|
||||
|
||||
|
||||
class BDataOutput;
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
class ZlibDecompressor : public ZlibCompressionBase {
|
||||
public:
|
||||
ZlibDecompressor(BDataOutput* output);
|
||||
~ZlibDecompressor();
|
||||
|
||||
status_t Init();
|
||||
status_t DecompressNext(const void* input,
|
||||
size_t inputSize);
|
||||
status_t Finish();
|
||||
|
||||
static status_t DecompressSingleBuffer(const void* input,
|
||||
size_t inputSize, void* output,
|
||||
size_t outputSize,
|
||||
size_t& _uncompressedSize);
|
||||
|
||||
private:
|
||||
z_stream fStream;
|
||||
BDataOutput* fOutput;
|
||||
bool fStreamInitialized;
|
||||
bool fFinished;
|
||||
};
|
||||
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
} // namespace BHPKG
|
||||
|
||||
} // namespace BPackageKit
|
||||
|
||||
|
||||
#endif // _PACKAGE__HPKG__PRIVATE__ZLIB_DECOMPRESSOR_H_
|
||||
Reference in New Issue
Block a user