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