MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
environment.hpp
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"
6
7class MSTL_API environment {
8private:
9 static string get_unsafe(const string& name);
10 static bool set_unsafe(const string& name, const string& value, bool overwrite = true);
11
12public:
13#ifdef MSTL_PLATFORM_WINDOWS__
14 static constexpr char delimiter = ';';
15#else
16 static constexpr char delimiter = ':';
17#endif
18
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);
22
23 static bool exists(const string& name);
24
25 static unordered_map<string, string> all_envs();
26
27 static vector<string> path_list();
28 static bool add_to_path(const string& path, int position = 1);
29
30 static string current_directory();
31 static string current_user();
32
33 static string temp_directory();
34 static string home_directory();
35};
36
38#endif // MSTL_CORE_SYSTEM_ENV_VARIABLE_HPP__
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