ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
strings/fwds.hpp
Go to the documentation of this file.
1/** ************************************************************************************************
2 * \file
3 * This header file is part of module \alib_strings of the \aliblong.
4 *
5 * \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
6 * Published under \ref mainpage_license "Boost Software License".
7 **************************************************************************************************/
8#ifndef HPP_ALIB_STRINGS_FWDS
9#define HPP_ALIB_STRINGS_FWDS 1
10
11#if !defined(HPP_ALIB_CHARACTERS_CHARACTERS)
13#endif
14
15
16// #################################################################################################
17// Preprocessor definitions
18// #################################################################################################
19#if ALIB_DEBUG_STRINGS
20# define ALIB_STRING_DBG_CHK(instance) \
21 { \
22 (instance)->dbgCheck(); \
23 }
24#else
25# define ALIB_STRING_DBG_CHK(instance)
26#endif
27
28
29// #################################################################################################
30// Forward declarations
31// #################################################################################################
32namespace alib { namespace strings {
33
34 template<typename TChar> class TString;
35 template<typename TChar> class TSubstring;
36 template<typename TChar> class TCString;
37 template<typename TChar> class TAString;
38 template<typename TChar, integer TCapacity> class TLocalString;
39 template<typename TChar> class TStringNZT;
40
41 template<typename TChar> struct TNumberFormat;
42 template<typename TChar> class TFormat;
43 template<typename TChar> class TStringLengthResetter;
44
45 /**
46 * This TMP struct is tested by implicit "auto cast" operators. Those might be disabled for
47 * combinations of types.
48 *
49 * For example, implicit casting from class \b AString to sibling types \b CString and \b Substring
50 * has to be forbidden, because both are also constructible implicitly from this class and hence an
51 * ambiguity between implicit cast and implicit construction would arise.
52 *
53 * Custom classes might encounter similar problems. In that case, this TMP type may be specialized
54 * to mitigate compilation issues.
55 *
56 * @tparam TFrom The type that allows implicit auto-casts.
57 * @tparam TImOrExplict Denotes if implicit or explicit casts are suppressed.
58 * @tparam TTo The destination type that auto-casts should be suppressed for.
59 * @tparam TEnableIf Helper parameter used for templated specializations of this struct.
60 */
61 template<typename TFrom,
63 typename TTo,
64 typename TEnableIf =void>
65 struct T_SuppressAutoCast : public std::false_type {};
66
67} // namespace alib[::strings]
68
69// #################################################################################################
70// Alias names
71// #################################################################################################
72
73/// Type alias in namespace \b alib.
74using String = strings::TString <character>;
75
76/// Type alias in namespace \b alib.
77using ComplementString = strings::TString <complementChar>;
78
79/// Type alias in namespace \b alib.
80using StrangeString = strings::TString <strangeChar>;
81
82/// Type alias in namespace \b alib.
83using NString = strings::TString <nchar>;
84
85/// Type alias in namespace \b alib.
86using WString = strings::TString <wchar>;
87
88/// Type alias in namespace \b alib.
89using XString = strings::TString <xchar>;
90
91/// Type alias in namespace \b alib.
92using Substring = strings::TSubstring <character>;
93
94/// Type alias in namespace \b alib.
95using ComplementSubstring = strings::TSubstring <complementChar>;
96
97/// Type alias in namespace \b alib.
98using StrangeSubstring = strings::TSubstring <strangeChar>;
99
100/// Type alias in namespace \b alib.
101using NSubstring = strings::TSubstring <nchar>;
102
103/// Type alias in namespace \b alib.
104using WSubstring = strings::TSubstring <wchar>;
105
106/// Type alias in namespace \b alib.
107using XSubstring = strings::TSubstring <xchar>;
108
109/// Type alias in namespace \b alib.
110using CString = strings::TCString <character>;
111
112/// Type alias in namespace \b alib.
113using ComplementCString= strings::TCString <complementChar>;
114
115/// Type alias in namespace \b alib.
116using StrangeCString = strings::TCString <strangeChar>;
117
118/// Type alias in namespace \b alib.
119using NCString = strings::TCString <nchar>;
120
121/// Type alias in namespace \b alib.
122using WCString = strings::TCString <wchar>;
123
124/// Type alias in namespace \b alib.
125using XCString = strings::TCString <xchar>;
126
127/// Type alias in namespace \b alib.
128using AString = strings::TAString <character>;
129
130/// Type alias in namespace \b alib.
131using ComplementAString= strings::TAString <complementChar>;
132
133/// Type alias in namespace \b alib.
134using StrangeAString = strings::TAString <strangeChar>;
135
136/// Type alias in namespace \b alib.
137using NAString = strings::TAString <nchar>;
138
139/// Type alias in namespace \b alib.
140using WAString = strings::TAString <wchar>;
141
142/// Type alias in namespace \b alib.
143using XAString = strings::TAString <xchar>;
144
145/// Type alias in namespace \b alib.
146using StringNZT = strings::TStringNZT <character>;
147
148/// Type alias in namespace \b alib.
149using ComplementStringNZT= strings::TStringNZT <complementChar>;
150
151/// Type alias in namespace \b alib.
152using StrangeStringNZT = strings::TStringNZT <strangeChar>;
153
154/// Type alias in namespace \b alib.
155using NStringNZT = strings::TStringNZT <nchar>;
156
157/// Type alias in namespace \b alib.
158using WStringNZT = strings::TStringNZT <wchar>;
159
160/// Type alias in namespace \b alib.
161using XStringNZT = strings::TStringNZT <xchar>;
162
163/// Type alias in namespace \b alib.
164template<integer TCapacity>
166
167/// Type alias in namespace \b alib.
168template<integer TCapacity>
170
171/// Type alias in namespace \b alib.
172template<integer TCapacity>
174
175/// Type alias in namespace \b alib.
176template<integer TCapacity>
177using NLocalString = strings::TLocalString <nchar , TCapacity>;
178
179/// Type alias in namespace \b alib.
180template<integer TCapacity>
181using WLocalString = strings::TLocalString <wchar , TCapacity>;
182
183/// Type alias in namespace \b alib.
184template<integer TCapacity>
185using XLocalString = strings::TLocalString <xchar , TCapacity>;
186
187/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,8>}.
189
190/// Type alias name for \alib{strings;TLocalString;TLocalString<character,8>}.
192
193/// Type alias name for \alib{strings;TLocalString;TLocalString<character,16>}.
195
196/// Type alias name for \alib{strings;TLocalString;TLocalString<character,32>}.
198
199/// Type alias name for \alib{strings;TLocalString;TLocalString<character,64>}.
201
202/// Type alias name for \alib{strings;TLocalString;TLocalString<character,128>}.
204
205/// Type alias name for \alib{strings;TLocalString;TLocalString<character,256>}.
207
208/// Type alias name for \alib{strings;TLocalString;TLocalString<character,512>}.
210
211/// Type alias name for \alib{strings;TLocalString;TLocalString<character,1024>}.
213
214/// Type alias name for \alib{strings;TLocalString;TLocalString<character,2048>}.
216
217/// Type alias name for \alib{strings;TLocalString;TLocalString<character,4096>}.
219
220/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,16>}.
222
223/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,32>}.
225
226/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,64>}.
228
229/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,128>}.
231
232/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,256>}.
234
235/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,512>}.
237
238/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,1024>}.
240
241/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,2048>}.
243
244/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,4096>}.
246
247/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,8>}.
249
250/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,16>}.
252
253/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,32>}.
255
256/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,64>}.
258
259/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,128>}.
261
262/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,256>}.
264
265/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,512>}.
267
268/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,1024>}.
270
271/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,2048>}.
273
274/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,4096>}.
276
277
278/// Type alias in namespace \b alib.
280
281/// Type alias in namespace \b alib.
283
284/// Type alias in namespace \b alib.
286
287/// Type alias in namespace \b alib.
289
290/// Type alias in namespace \b alib.
292
293/// Type alias in namespace \b alib.
295
296
297/// Type alias in namespace \b alib.
299
300/// Type alias in namespace \b alib.
302
303/// Type alias in namespace \b alib.
305
306/// Type alias in namespace \b alib.
308
309/// Type alias in namespace \b alib.
311
312/// Type alias in namespace \b alib.
314
315/// Type alias in namespace \b alib.
317
318/// Type alias in namespace \b alib.
320
321/// Type alias in namespace \b alib.
323
324/// Type alias in namespace \b alib.
326
327/// Type alias in namespace \b alib.
329
330/// Type alias in namespace \b alib.
332
333} // namespace [alib]
334
335
336// #################################################################################################
337// Macros
338// #################################################################################################
339
340#if !ALIB_CHARACTERS_WIDE
341# define ALIB_STRINGS_TO_NARROW( src,dest,bufSize ) decltype(src)& dest(src);
342# define ALIB_STRINGS_TO_NARROW_ARG( src,bufSize ) src;
343# define ALIB_STRINGS_TO_WIDE( src,dest,bufSize ) alib::strings::TLocalString<wchar,bufSize> dest(src);
344# define ALIB_STRINGS_TO_WIDE_ARG( src,bufSize ) alib::strings::TLocalString<wchar,bufSize>(src);
345# define ALIB_STRINGS_FROM_NARROW( src,dest,bufSize ) decltype(src)& dest(src);
346# define ALIB_STRINGS_FROM_NARROW_ARG( src,bufSize ) src;
347# define ALIB_STRINGS_FROM_WIDE( src,dest,bufSize ) alib::strings::TLocalString<nchar,bufSize> dest(src);
348# define ALIB_STRINGS_FROM_WIDE_ARG src,bufSize ) alib::strings::TLocalString<nchar,bufSize>(src);
349#else
350# define ALIB_STRINGS_TO_NARROW( src,dest,bufSize ) alib::strings::TLocalString<nchar,bufSize> dest(src);
351# define ALIB_STRINGS_TO_NARROW_ARG( src,bufSize ) alib::strings::TLocalString<nchar,bufSize>(src);
352# define ALIB_STRINGS_TO_WIDE( src,dest,bufSize ) decltype(src)& dest= src;
353# define ALIB_STRINGS_TO_WIDE_ARG( src,bufSize ) src;
354# define ALIB_STRINGS_FROM_NARROW( src,dest,bufSize ) alib::strings::TLocalString<wchar,bufSize> dest(src);
355# define ALIB_STRINGS_FROM_NARROW_ARG( src,bufSize ) alib::strings::TLocalString<wchar,bufSize>(src);
356# define ALIB_STRINGS_FROM_WIDE( src,dest,bufSize ) decltype(src)& dest= src;
357# define ALIB_STRINGS_FROM_WIDE_ARG( src,bufSize ) src;
358#endif
359
360
361
362#endif // HPP_ALIB_STRINGS_FWDS
Definition alib.cpp:57