Environment.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "il2cpp-config.h"
  3. #include "utils/Expected.h"
  4. #include <string>
  5. #include <stdint.h>
  6. #include <vector>
  7. #undef SetEnvironmentVariable // Get rid of windows.h #define.
  8. #undef GetEnvironmentVariable // Get rid of windows.h #define.
  9. struct Il2CppArray;
  10. namespace il2cpp
  11. {
  12. namespace os
  13. {
  14. class Environment
  15. {
  16. public:
  17. static std::string GetMachineName();
  18. static int32_t GetProcessorCount();
  19. static std::string GetOsVersionString();
  20. static std::string GetOsUserName();
  21. static std::string GetEnvironmentVariable(const std::string& name);
  22. static void SetEnvironmentVariable(const std::string& name, const std::string& value);
  23. static std::vector<std::string> GetEnvironmentVariableNames();
  24. static std::string GetHomeDirectory();
  25. static std::vector<std::string> GetLogicalDrives();
  26. static void Exit(int result);
  27. static NORETURN void Abort();
  28. static utils::Expected<std::string> GetWindowsFolderPath(int32_t folder);
  29. static utils::Expected<bool> Is64BitOs();
  30. };
  31. }
  32. }