1#ifndef NEFORCE_CORE_SYSTEM_ENV_VARIABLE_HPP__
2#define NEFORCE_CORE_SYSTEM_ENV_VARIABLE_HPP__
14NEFORCE_BEGIN_NAMESPACE__
33#ifdef NEFORCE_PLATFORM_WINDOWS
44 NEFORCE_NODISCARD
static string get(
const string& name);
53 static bool set(
const string& name,
const string& value,
bool overwrite =
true);
60 static bool unset(
const string& name);
67 NEFORCE_NODISCARD
static bool exists(
const string& name);
129NEFORCE_END_NAMESPACE__
static string current_directory()
获取当前工作目录
static string current_user()
获取当前用户名
static string home_directory()
获取用户主目录路径
static constexpr char delimiter
路径分隔符
static bool exists(const string &name)
检查环境变量是否存在
static string temp_directory()
获取临时目录路径
static vector< string > path_list()
获取PATH环境变量的路径列表
static string config_directory()
获取应用程序配置目录路径
static bool unset(const string &name)
删除环境变量
static unordered_map< string, string > all_envs()
获取所有环境变量
static string get(const string &name)
获取环境变量值
static bool set(const string &name, const string &value, bool overwrite=true)
设置环境变量
static string app_data_directory()
获取应用程序数据目录路径
static bool add_to_path(const string &path, int position=1)
向PATH环境变量添加路径