diff options
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/CResFile.h | 50 |
1 files changed, 50 insertions, 0 deletions
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; +}; |