mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-17 02:57:01 +00:00
Restore CZipOutputStream from MP3 prototype
Former-commit-id: 529c359935
This commit is contained in:
@@ -11,15 +11,14 @@ template < typename T >
|
||||
void coutput_stream_helper(const T& t, COutputStream& out);
|
||||
|
||||
class COutputStream {
|
||||
void DoPut(const void* ptr, size_t len);
|
||||
void DoFlush();
|
||||
|
||||
public:
|
||||
COutputStream(int len);
|
||||
virtual ~COutputStream();
|
||||
virtual void Write(const void* ptr, size_t len) = 0;
|
||||
void WriteBits(uint val, uint bitCount);
|
||||
|
||||
void DoPut(const void* ptr, size_t len);
|
||||
void DoFlush();
|
||||
void Flush();
|
||||
void FlushShiftRegister();
|
||||
void Put(const void* ptr, size_t len) {
|
||||
@@ -48,7 +47,6 @@ public:
|
||||
*(reinterpret_cast< u8* >(mBufPtr) + mUnwrittenLen++) = c;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
uint mUnwrittenLen;
|
||||
uint mBufLen;
|
||||
|
||||
27
include/Kyoto/Streams/CZipOutputStream.hpp
Normal file
27
include/Kyoto/Streams/CZipOutputStream.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef _CZIPOUTPUTSTREAM
|
||||
#define _CZIPOUTPUTSTREAM
|
||||
|
||||
|
||||
#include "Kyoto/Streams/COutputStream.hpp"
|
||||
|
||||
#include "rstl/auto_ptr.hpp"
|
||||
|
||||
#include "zlib/zlib.h"
|
||||
|
||||
class CZipOutputStream : public COutputStream {
|
||||
public:
|
||||
CZipOutputStream(COutputStream* out, int level);
|
||||
~CZipOutputStream();
|
||||
|
||||
void Finish();
|
||||
bool Process(bool v);
|
||||
void Write(const void* ptr, size_t len);
|
||||
private:
|
||||
COutputStream* mOutput;
|
||||
int mCompressedBytesWritten;
|
||||
rstl::auto_ptr<z_stream> mZStream;
|
||||
int mUnk;
|
||||
};
|
||||
|
||||
|
||||
#endif // _CZIPOUTPUTSTREAM
|
||||
Reference in New Issue
Block a user