YSTest: Configuration.h 源文件

YSTest PreAlpha_b500_20140530 The YSLib Test Project

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

- 文件列表
- 文件成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
Configuration.h
浏览该文件的文档.
1 /*
2 © 2012-2014 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 #ifndef NPL_INC_Configuration_h_
29 #define NPL_INC_Configuration_h_
30
31 #include "YModules.h"
32 #include YFM_NPL_NPLA1
33 #include YFM_YSLib_Service_TextFile
34
35 namespace NPL
36 {
37
39
40 using YSLib::File;
41 using YSLib::TextFile;
43
44
49 class YF_API Configuration
50 {
51 private:
52 ValueNode root;
53
54 public:
55 DefDeCtor(Configuration)
57 Configuration(ValueNode& node)
58 : root(static_cast<const ValueNode&>(node))
59 {}
61
62 Configuration(const ValueNode& node)
63 : root(node)
64 {}
65 Configuration(ValueNode&& node)
66 : root(std::move(node))
67 {}
68 Configuration(Configuration& conf)
69 : Configuration(static_cast<const Configuration&>(conf))
70 {}
72 template<typename... _tParams>
73 Configuration(_tParams&&... args)
74 : root(0, yforward(args)...)
75 {}
76 DefDeCopyCtor(Configuration)
77 DefDeMoveCtor(Configuration)
78
79 DefDeCopyAssignment(Configuration)
80 DefDeMoveAssignment(Configuration)
81
82 DefGetter(const ynothrow, const ValueNode&, Root, root)
83
88 YF_API friend TextFile&
89 operator>>(TextFile&, Configuration&);
90
92 DefGetter(const ynothrow, const ValueNode&, Node, root)
97 DefGetter(ynothrow, ValueNode&&, NodeRRef, std::move(root))
98 };
99
105 YF_API File&
106 operator<<(File&, const Configuration&);
107
108 } // namespace NPL;
109
110 #endif
111
NPL::Configuration
设置：使用 S 表达式存储外部状态。
Definition: Configuration.h:49
NPL::Configuration::Configuration
Configuration(const ValueNode &node)
Definition: Configuration.h:62
NPL::Configuration::Configuration
Configuration(_tParams &&...args)
Definition: Configuration.h:73
YSLib::UI::args
yconstfn const string _tParams && args
Definition: Loader.h:111
DefDeCopyCtor
#define DefDeCopyCtor(_t)
Definition: YBaseMacro.h:136
YSLib::TextFile
文本文件类。
Definition: TextFile.h:56
YF_API
#define YF_API
Definition: Platform.h:64
YSLib::File
文件基类。
Definition: File.h:43
yforward
#define yforward(_expr)
根据参数类型使用 std::forward 传递对应参数。
Definition: ydef.h:722
DefGetter
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:180
NPL::Configuration::Configuration
Configuration(ValueNode &&node)
Definition: Configuration.h:65
YModules.h
NPL::NPL
NPL 元标签。
Definition: NPL.h:45
DefDeMoveCtor
#define DefDeMoveCtor(_t)
Definition: YBaseMacro.h:141
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:514
YSLib::ValueNode
值类型节点。
Definition: ValueNode.h:45
NPL::Configuration::root
ValueNode root
Definition: Configuration.h:52
DefDeMoveAssignment
#define DefDeMoveAssignment(_t)
Definition: YBaseMacro.h:159
NPL::Configuration::DefDeCtor
DefDeCtor(Configuration) Configuration(ValueNode &node)
Definition: Configuration.h:55
NPL::Configuration::Configuration
Configuration(Configuration &conf)
Definition: Configuration.h:68
DefDeCopyAssignment
#define DefDeCopyAssignment(_t)
Definition: YBaseMacro.h:154