#pragma once class TARCH_EXP DataLoadAndSave { public: DataLoadAndSave(); virtual ~DataLoadAndSave(); private: static CString m_sLocation; enum EDataStyle { EInt = 1, EDouble, EDWORD, ECString, EBool, EBytes, }; private: static bool CompleteRecordDataCString(CString sKey, CString& sValue, CString sTermName, bool bRead = true, EDataStyle dataStyle = ECString); static bool CompleteRecordDataDWORD(CString sKey, DWORD& dwValue, CString sTermName, bool bRead = true, EDataStyle dataStyle = EDWORD); static bool CompleteRecordDataBytes(CString sKey, byte* pValue, CString sTermName, bool bRead = true, EDataStyle dataStyle = EBytes); static bool CompleteRecordData(CString sKey, CString& sValue, DWORD& dwValue, byte* pValue, CString sTermName, bool bRead, EDataStyle dataStyle); static long CompleteRegSetValueEx(HKEY hKEY, CString sKey, LPBYTE pParametervValue, DWORD cbDataLength, EDataStyle dataStyle); public: static bool readRecordDataInt(CString sKey, int& iValue, CString sTermName); static bool writeRecordDataInt(CString sKey, int& iValue, CString sTermName); static bool readRecordDataUINT(CString sKey, UINT& iValue, CString sTermName); static bool writeRecordDataUINT(CString sKey, UINT& iValue, CString sTermName); static bool readRecordDataDouble(CString sKey, double& dValue, CString sTermName); static bool writeRecordDataDouble(CString sKey, double& dValue, CString sTermName); static bool readRecordDataDWORD(CString sKey, DWORD& dwValue, CString sTermName); static bool writeRecordDataDWORD(CString sKey, DWORD& dwValue, CString sTermName); static bool readRecordDataCString(CString sKey, CString& sValue, CString sTermName); static bool writeRecordDataCString(CString sKey, CString& sValue, CString sTermName); static bool readRecordDataBool(CString sKey, bool& bValue, CString sTermName); static bool writeRecordDataBool(CString sKey, bool& bValue, CString sTermName); static bool readRecordDataBytes(CString sKey, byte* pValue, CString sTermName); static bool writeRecordDataBytes(CString sKey, byte* pValue, CString sTermName); static bool JudgeDataWhetherOutOfRange(int x, int y); };