system.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #include <vector>
  3. #include "base/define.h"
  4. namespace ylib
  5. {
  6. namespace system
  7. {
  8. //睡眠
  9. void sleep_msec(uint32 msec);
  10. //取随机数
  11. int64 random(int64 min, int64 max);
  12. //取运行目录
  13. std::string current_dir();
  14. //取EXE目录
  15. std::string application_dir();
  16. //取运行全路径
  17. std::string current_filepath();
  18. //取临时目录
  19. std::string temp_path();
  20. //桌面路径
  21. std::string desktop_path();
  22. //取当前用户目录
  23. std::string currentuser_path();
  24. //系统通知
  25. void notification(const std::string& title, const std::string& message);
  26. //mac地址
  27. std::vector<std::string> mac();
  28. #ifdef _WIN32
  29. //打开浏览器
  30. void open_browser(const std::string& url);
  31. //磁盘列表
  32. std::vector<char> disk_list();
  33. //取磁盘信息
  34. ylib::DiskCapacity disk_capacity(char disk_name);
  35. //取容量最大磁盘号
  36. char disk_max_capacity();
  37. //系统版本
  38. std::string version();
  39. //取系统最后错误描述
  40. std::string last_error();
  41. #endif
  42. }
  43. }