YSTest: ycont.h 源文件

YSTest PreAlpha_b500_20140530 The YSLib Test Project

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

- 文件列表
- 文件成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
ycont.h
浏览该文件的文档.
1 /*
2 © 2010-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 YSL_INC_Adaptor_ycont_h_
29 #define YSL_INC_Adaptor_ycont_h_ 1
30
31 #include "YModules.h"
32 #include "CHRLib/YModules.h"
33 #include YFM_YSLib_Adaptor_YAdaptor
34 #include <utility>
35 #include <ystdex/tuple.hpp>
36 #include YFM_CHRLib_CHRDefinition
37
38
39 //包含 flex_string 。
40 #ifdef YSL_USE_FLEX_STRING
41 # include <loki/flex/flex_string_shell.h>
42
43 namespace YSLib
44 {
45
46 /*
47 # ifdef YSL_USE_YASLI_VECTOR
48 # include "yaslivsp.hpp"
49 # else
50 # include <loki/flex/vectorstringstorage.h>
51 # endif
52 */
53 # include <loki/flex/allocatorstringstorage.h>
54 # include <loki/flex/smallstringopt.h>
55 # ifdef YSL_USE_COPY_ON_WRITE
56 # include <loki/flex/cowstringopt.h>
57 # endif
58
59 } // namespace YSLib;
60
61 #else
62 //# include <string>
63 //# include <ext/vstring.h>
64 #endif
65 #include <ystdex/string.hpp>
66
67 //包含标准库容器和容器适配器或代用品。
68 #include <array>
69 #include <deque>
70 #include <forward_list>
71 #include <list>
72 //包含 YASLI 。
73 #ifdef YSL_USE_YASLI_VECTOR
74 # include <loki/yasli/yasli_vector.h>
75 #else
76 # include <vector>
77 #endif
78
79 #include <map>
80 #include <set>
81
82 #include <unordered_set>
83 #include <unordered_map>
84
85 #include <queue>
86 #include <stack>
87
88 namespace YSLib
89 {
90
91 using std::forward_as_tuple;
92 using std::get;
93 using std::ignore;
94 using std::make_pair;
95 using std::make_tuple;
96 using std::pair;
97 using std::tie;
98 using std::tuple;
99 using std::tuple_cat;
100
101
102 using std::array;
103 using std::deque;
104 using std::forward_list;
105 using std::list;
106 #ifdef YSL_USE_YASLI_VECTOR
107 using yasli::vector;
108 #else
109 using std::vector;
110 #endif
111
112 using std::map;
113 using std::multimap;
114 using std::multiset;
115 using std::set;
116
117 using std::unordered_map;
119 using std::unordered_multimap;
121 using std::unordered_multiset;
122 using std::unordered_set;
123
124 using std::stack;
125 using std::priority_queue;
126 using std::queue;
127
128 #ifdef YSL_USE_FLEX_STRING
129
130 template<typename _tChar,
131 class _tCharTrait = std::char_traits<_tChar>,
132 class _tAlloc = std::allocator<_tChar>,
133 class _tStorage =
134 # if YSL_OPT_SMALL_STRING_LENGTH > 0
135 SmallStringOpt<
136 # endif
137 # ifdef YSL_USE_COPY_ON_WRITE
138 CowStringOpt<
139 # endif
140 AllocatorStringStorage<_tChar, _tAlloc>
141 # ifdef YSL_USE_COPY_ON_WRITE
142 >
143 # endif
144 # if YSL_OPT_SMALL_STRING_LENGTH > 0
145 , YSL_OPT_SMALL_STRING_LENGTH
146 >
147 #endif
148 >
149 struct GSStringTemplate
150 {
151 using basic_string = flex_string<_tChar, _tCharTrait, _tAlloc, _tStorage>;
152 };
153
154 #else
155
156 template<typename _tChar>
157 struct GSStringTemplate
158 {
159 using basic_string = std::basic_string<_tChar>;
160 };
161
162 #endif
163
164 using string = GSStringTemplate<char>::basic_string;
165
166 // YSLib 基本字符串（使用 UCS-2 / UCS-4 ）。
167 using ucs2string = GSStringTemplate<CHRLib::ucs2_t>::basic_string;
168 using ucs4string = GSStringTemplate<CHRLib::ucs4_t>::basic_string;
169
170 } // namespace YSLib;
171
172 #endif
173
string.hpp
ISO C++ 标准字符串扩展。
YSLib::ucs4string
GSStringTemplate< CHRLib::ucs4_t >::basic_string ucs4string
Definition: ycont.h:168
YSL_OPT_SMALL_STRING_LENGTH
#define YSL_OPT_SMALL_STRING_LENGTH
使用小字符串优化。
Definition: config.h:58
YSLib::ucs2string
GSStringTemplate< CHRLib::ucs2_t >::basic_string ucs2string
Definition: ycont.h:167
YSLib::GSStringTemplate::basic_string
std::basic_string< _tChar > basic_string
Definition: ycont.h:159
tuple.hpp
元组类型和操作。
YSLib::GSStringTemplate
Definition: ycont.h:157
YModules.h