metaforce/Runtime/IOStreams.hpp

41 lines
973 B
C++
Raw Normal View History

2016-02-13 09:02:47 +00:00
#ifndef __PSHAG_IOSTREAMS_HPP__
#define __PSHAG_IOSTREAMS_HPP__
2015-08-23 23:58:07 +00:00
#include "RetroTypes.hpp"
2016-03-04 23:04:53 +00:00
#include <athena/IStreamReader.hpp>
#include <athena/IStreamWriter.hpp>
#include <athena/MemoryReader.hpp>
2015-08-23 23:58:07 +00:00
#include <zlib.h>
2016-03-04 23:04:53 +00:00
namespace urde
2015-08-23 23:58:07 +00:00
{
2016-03-04 23:04:53 +00:00
using CInputStream = athena::io::IStreamReader;
using COutputStream = athena::io::IStreamWriter;
2015-08-23 23:58:07 +00:00
struct DecryptionCtx
{
s32 x1c_encVal;
s32 x20_encShift;
s32 DecryptRead(CInputStream& in, s32 key);
};
2016-03-04 23:04:53 +00:00
using CMemoryInStream = athena::io::MemoryReader;
2015-08-23 23:58:07 +00:00
class CZipInputStream : public CInputStream
{
std::unique_ptr<u8[]> x24_compBuf;
std::unique_ptr<CInputStream> x28_strm;
z_stream x30_zstrm = {};
public:
CZipInputStream(std::unique_ptr<CInputStream>&& strm);
~CZipInputStream();
atUint64 readUBytesToBuf(void *buf, atUint64 len);
2016-03-04 23:04:53 +00:00
void seek(atInt64, athena::SeekOrigin) {}
2015-08-23 23:58:07 +00:00
atUint64 position() const {return 0;}
atUint64 length() const {return 0;}
};
}
2016-02-13 09:02:47 +00:00
#endif // __PSHAG_IOSTREAMS_HPP__