#pragma once #ifndef LIB_DEVICEERRORINFOR_EXPORTS #ifdef WIN_64BIT #ifdef _DEBUG #pragma comment(lib, "libDeviceErrorInforX64D.lib") #else #pragma comment(lib, "libDeviceErrorInforX64.lib") #endif #else #ifdef _DEBUG #pragma comment(lib, "libDeviceErrorInforD.lib") #else #pragma comment(lib, "libDeviceErrorInfor.lib") #endif #endif #endif #include #include "DeviceErrorCode.h" using namespace std; enum DEVICE_ERROR_INFO_TYPE { INFO_TYPE_ERROR, INFO_TYPE_WARN }; class DeviceError { public: DeviceError(void); ~DeviceError(void); string getCode(); string getName(); string getDescription(); string getSolution(); string getNotifyType(); string getInterlock(); string getBackCommand(); void setCode(string code); void setName(string name); void setDescription(string desc); void setSolution(string solu); void setNotifyType(string notifytype); void setInterlock(string interlock); void setBackCommand(string backCommand); private: string m_strCode; string m_strName; string m_strDescription; string m_strSolution; string m_strNotifyType; string m_strInterlock; string m_strBackCommand; //string m_str; }; class DeviceErrorInfor { public: DeviceErrorInfor(void); ~DeviceErrorInfor(void); bool getDeviceError(const string strFileName , const string strCode, DeviceError &error); bool getDeviceWarn(const string strFileName, const string strCode, DeviceError &warn); bool getDeviceError(const string strCode, DeviceError &error); bool getDeviceWarn(const string strCode, DeviceError &warn); void setFileName(DEVICE_ERROR_INFO_TYPE type, const string strLang ,const string strInfoFileName ); private: string m_strFileName; bool getInfor(const string strFileName ,const string strType , const string strCode, DeviceError &error); }; class DeviceErrorList { public: DeviceErrorList(void); ~DeviceErrorList(void); bool isError(); bool isExist(const string strCode); bool add(DeviceError &error); bool remove(const string strCode); void clear(); int size(); DeviceError &item(int index); private: vector m_list; };