#pragma once #include "common.h" class AFX_EXT_CLASS 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; };