YSTest: YCoreUtilities.cpp 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

YCoreUtilities.cpp
浏览该文件的文档.
1 /*
2 © 2014-2015 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #include "YSLib/Core/YModules.h"
29 #include YFM_YSLib_Core_YCoreUtilities
30 #include <cstdlib> // for std::getenv;
31
32 namespace YSLib
33 {
34
35 bool
36 FetchEnvironmentVariable(string& res, const char* var)
37 {
38 if(const auto val = std::getenv(Nonnull(var)))
39 {
40 res = val;
41 return true;
42 }
43 return {};
44 }
45
46 } // namespace YSLib;
47
platform::Nonnull
_type && Nonnull(_type &&p) ynothrow
断言并返回非空指针。
Definition: Debug.h:411
YModules.h
YSLib::FetchEnvironmentVariable
bool FetchEnvironmentVariable(string &res, const char *var)
Definition: YCoreUtilities.cpp:36
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:45