YSTest: ycont.h 源文件

YSTest PreAlpha_b400_20130424 The YSLib Test Project

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

- 文件列表
- 文件成员

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