system_settings.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef FOUNDATION_SETTINGS_SYSTEM_SETTINGS_H
  2. #define FOUNDATION_SETTINGS_SYSTEM_SETTINGS_H
  3. #include <string>
  4. #include <vector>
  5. namespace settings {
  6. class SystemSettings {
  7. public:
  8. SystemSettings() = default;
  9. bool UpdateSysInfo();
  10. /// @brief
  11. /// @return
  12. bool UpdateDiskInfo();
  13. bool UpdateMemInfo();
  14. void UpdateNetDev();
  15. int totalDiskSpace;
  16. int freeDiskSpace;
  17. int totalMemory;
  18. int freeMemory;
  19. std::string appVer;
  20. std::string sysVer;
  21. std::string sysTime;
  22. std::string upgradeTime;
  23. std::string updateConfigTime;
  24. struct NetCard {
  25. std::string ifname;
  26. std::string ipAddr;
  27. std::string MAC;
  28. std::string mask;
  29. std::string gateway;
  30. int32_t rxPackets;
  31. int32_t rxBytes;
  32. int32_t rxErrs;
  33. int32_t rxDrop;
  34. int32_t rxFifoErr;
  35. int32_t rxFrameErr;
  36. int32_t rxCompressed;
  37. int32_t rxMulticast;
  38. int32_t txPackets;
  39. int32_t txBytes;
  40. int32_t txErrs;
  41. int32_t txDrop;
  42. int32_t txFifoErr;
  43. int32_t txCollisionErr;
  44. int32_t txCompressed;
  45. int32_t txCarrierErr;
  46. };
  47. std::vector<NetCard> netCards;
  48. };
  49. } // namespace settings
  50. #endif // FOUNDATION_SETTINGS_SYSTEM_SETTINGS_H