DIOS.Dev.MSG_V3.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <memory>
  3. #include <string>
  4. #include "DIOS.Dev.IODevice.hpp"
  5. #include "DIOS.Dev.IODevice.Detail.hpp"
  6. #include "Base64.h"
  7. namespace DIOS::Dev::Detail
  8. {
  9. //-----------------------------------------------------------------------------
  10. // ErrorMessage
  11. //-----------------------------------------------------------------------------
  12. namespace AttrKey
  13. {
  14. static const char* ErrorList = "ErrorList";
  15. }
  16. class MSGUnit
  17. {
  18. std::string m_pDevicePath;
  19. public:
  20. MSGUnit(std::string strPath);
  21. virtual ~MSGUnit();
  22. std::string JSGet();
  23. std::string GetKey();
  24. int AddWarnMessage(const char* Code, int& Level, const char* ResInfo, int nSenderID = 0);
  25. int DelWarnMessage(const char* Code, int& Level, const char* ResInfo);
  26. int AddErrorMessage(const char* Code, int& Level, const char* ResInfo, int nSenderID = 0);
  27. int DelErrorMessage(const char* Code, int& Level, const char* ResInfo);
  28. protected:
  29. std::string Key{ AttrKey ::ErrorList};
  30. std::string m_ErrorList{""};
  31. int AddMessage(const char* Code, int& Level, const char* ResInfo, int nMessageType, int nSenderID);
  32. int DelMessage(const char* Code, int& Level, const char* ResInfo, int nMessageType);
  33. };
  34. }