mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 13:47:57 +03:00

Some checks failed
Build Windows / build_windows (x86_32, Visual Studio 16 2019, installer32.nsi, win32_msvc2019, Win32) (push) Has been cancelled
Build Windows / build_windows (x86_64, Visual Studio 16 2019, installer64.nsi, win64_msvc2019_64, x64) (push) Has been cancelled
Build Android / build_android (apk) (push) Has been cancelled
Build Android / build_android (libretro) (push) Has been cancelled
Build iOS / build_ios (push) Has been cancelled
Build JavaScript / build_js (push) Has been cancelled
Build Linux / build_linux (push) Has been cancelled
Build Linux ARM32 / build_linux_arm32 (push) Has been cancelled
Build Linux ARM64 / build_linux_arm64 (push) Has been cancelled
Build macOS / build_macos (push) Has been cancelled
Build Windows Psf / build_windows_psf (off, x86_64, Visual Studio 16 2019, installer64.nsi, x64) (push) Has been cancelled
Build Windows Psf / build_windows_psf (on, x86_64, Visual Studio 16 2019, installer64.nsi, x64) (push) Has been cancelled
Check Format / run_clangformat (push) Has been cancelled
36 lines
916 B
C++
36 lines
916 B
C++
#pragma once
|
|
|
|
#include "Stream.h"
|
|
#include <vector>
|
|
#include <memory>
|
|
|
|
typedef struct _chd_file chd_file;
|
|
typedef struct chd_core_file core_file;
|
|
|
|
class CChdImageStream : public Framework::CStream
|
|
{
|
|
public:
|
|
CChdImageStream(std::unique_ptr<Framework::CStream> baseStream);
|
|
virtual ~CChdImageStream();
|
|
|
|
uint32 GetUnitSize() const;
|
|
|
|
virtual void Seek(int64 pos, Framework::STREAM_SEEK_DIRECTION whence) override;
|
|
virtual uint64 Tell() override;
|
|
virtual bool IsEOF() override;
|
|
virtual uint64 Read(void* dest, uint64 bytes) override;
|
|
virtual uint64 Write(const void* src, uint64 bytes) override;
|
|
|
|
protected:
|
|
uint64 GetTotalSize() const;
|
|
|
|
std::unique_ptr<Framework::CStream> m_baseStream;
|
|
core_file* m_file = nullptr;
|
|
chd_file* m_chd = nullptr;
|
|
uint64 m_unitCount = 0;
|
|
uint32 m_unitSize = 0;
|
|
uint32 m_hunkSize = 0;
|
|
uint64 m_position = 0;
|
|
std::vector<uint8> m_hunkBuffer;
|
|
uint32 m_hunkBufferIdx = ~0U;
|
|
};
|