YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
Configuration.h
浏览该文件的文档.
1 /*
2  Copyright by FrankHB 2012 - 2013.
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 "YSLib/Core/ValueNode.h"
32 #include "YSLib/Service/yftext.h"
33 
35 
36 
37 using YSLib::string;
39 
40 using YSLib::File;
41 using YSLib::TextFile;
42 using YSLib::ValueNode;
44 
45 
50 YF_API ValueNode
51 TransformConfiguration(const ValueNode&);
52 
53 
59 {
60 private:
61  ValueNode root;
62 
63 public:
64  DefDeCtor(Configuration)
66 
67  Configuration(const ValueNode& node)
68  : root(node)
69  {}
70  Configuration(ValueNode&& node)
71  : root(std::move(node))
72  {}
73  Configuration(Configuration& conf)
74  : Configuration(static_cast<const Configuration&>(conf))
75  {}
77  template<typename... _tParams>
78  Configuration(_tParams&&... args)
79  : root(0, yforward(args)...)
80  {}
81  DefDeCopyCtor(Configuration)
82  DefDeMoveCtor(Configuration)
83 
84  DefDeCopyAssignment(Configuration)
85  DefDeMoveAssignment(Configuration)
86 
87  DefGetter(const ynothrow, const ValueNode&, Root, root)
88 
93  friend TextFile&
94  operator>>(TextFile&, Configuration&);
95 
97  DefGetter(const ynothrow, const ValueNode&, Node, root)
102  DefGetter(ynothrow, ValueNode&&, NodeRRef, std::move(root))
103 };
104 
109 YF_API File&
110 operator<<(File&, const Configuration&);
111 
113 
114 #endif
115