1#ifndef MSTL_CORE_SYSTEM_ENV_VARIABLE_HPP__
2#define MSTL_CORE_SYSTEM_ENV_VARIABLE_HPP__
3#include "../container/unordered_map.hpp"
4#include "../string/string.hpp"
7class MSTL_API environment {
9 static string get_unsafe(
const string& name);
10 static bool set_unsafe(
const string& name,
const string& value,
bool overwrite =
true);
13#ifdef MSTL_PLATFORM_WINDOWS__
14 static constexpr char delimiter =
';';
16 static constexpr char delimiter =
':';
19 static string get(
const string& name);
20 static bool set(
const string& name,
const string& value,
bool overwrite =
true);
21 static bool unset(
const string& name);
23 static bool exists(
const string& name);
25 static unordered_map<string, string> all_envs();
27 static vector<string> path_list();
28 static bool add_to_path(
const string& path,
int position = 1);
30 static string current_directory();
31 static string current_user();
33 static string temp_directory();
34 static string home_directory();
MSTL_ALWAYS_INLINE enable_if_t< is_void_v< T >, future_result_t< T > > get(future< T > &f)
通用future结果获取函数
#define MSTL_END_NAMESPACE__
结束全局命名空间MSTL
#define MSTL_BEGIN_NAMESPACE__
开始全局命名空间MSTL