From 37e364b2c6cc7487a1c888d256a73e5337bb7189 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 14 Jun 2023 00:50:34 +0100 Subject: initial commit --- src/T2DLL/CResFile.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/T2DLL/CResFile.h (limited to 'src/T2DLL/CResFile.h') diff --git a/src/T2DLL/CResFile.h b/src/T2DLL/CResFile.h new file mode 100644 index 0000000..5c10f21 --- /dev/null +++ b/src/T2DLL/CResFile.h @@ -0,0 +1,50 @@ +#pragma once +#include "common.h" + +class DLL_EXPORT CResFile { +public: + CResFile(); + virtual ~CResFile(); + BOOL OpenResource(HINSTANCE inst, int name, int type); + BOOL OpenResource(HINSTANCE inst, const char* name, int type); + BOOL OpenResource(HINSTANCE inst, int name, const char* type); + BOOL OpenResource(HINSTANCE inst, const char* name, const char* type); + BOOL OpenResource(HINSTANCE inst, HRSRC rsrc); + BOOL OpenResource(const char* path, int name, int type); +protected: + void SetupResource(); + void Reset(); + BOOL Token(char* outStr); +public: + BOOL operator>>(unsigned char& out); + BOOL operator>>(int& out); + BOOL operator>>(short& out); + BOOL operator>>(long& out); + BOOL operator>>(unsigned int& out); + BOOL operator>>(unsigned long& out); + BOOL operator>>(unsigned short& out); + BOOL operator>>(POINT& outPoint); + BOOL operator>>(RECT& outRect); + BOOL operator>>(SIZE& outSize); + BOOL operator>>(char* outStr); + BOOL operator>>(CString& outStr); + void SkipDescriptor(); + void End(); + + void GetResourceInfo(HINSTANCE* outInstance, HRSRC* outRsrc) const { + *outInstance = mInstance; + *outRsrc = mRsrc; + } + + BOOL IsBinaryMode() const { return mIsBinaryMode; } + BOOL IsSubPlugin() const { return mIsSubPlugin; } + +private: + BOOL mIsBinaryMode; + HINSTANCE mInstance; + HRSRC mRsrc; + char *mBuffer; + char *mPos; + unsigned int mRemaining; + BOOL mIsSubPlugin; +}; -- cgit v1.2.3