system.h 974 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. //取运行全路径
  15. std::string current_filepath();
  16. //取临时目录
  17. std::string temp_path();
  18. //桌面路径
  19. std::string desktop_path();
  20. //取当前用户目录
  21. std::string currentuser_path();
  22. //系统通知
  23. void notification(const std::string& title, const std::string& message);
  24. //mac地址
  25. std::vector<std::string> mac();
  26. #ifdef _WIN32
  27. //打开浏览器
  28. void open_browser(const std::string& url);
  29. //磁盘列表
  30. std::vector<char> disk_list();
  31. //取磁盘信息
  32. ylib::DiskCapacity disk_capacity(char disk_name);
  33. //取容量最大磁盘号
  34. char disk_max_capacity();
  35. //系统版本
  36. std::string version();
  37. //取系统最后错误描述
  38. std::string last_error();
  39. #endif
  40. }
  41. }