ALib C++ Library
Library Version: 2412 R0
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#pragma once
13
14// #################################################################################################
15// Preprocessor definitions
16// #################################################################################################
17#if ALIB_DEBUG_STRINGS
18# define ALIB_STRING_DBG_CHK(instance) \
19 { \
20 (instance)->dbgCheck(); \
21 }
22#else
23# define ALIB_STRING_DBG_CHK(instance)
24#endif
25
26
27// #################################################################################################
28// Forward declarations
29// #################################################################################################
30namespace alib { namespace strings {
31
32 template<typename TChar> class TString;
33 template<typename TChar> class TSubstring;
34 template<typename TChar> class TCString;
35 template<typename TChar, typename TAllocator> class TAString;
36 template<typename TChar, integer TCapacity, typename TAllocator> class TLocalString;
37 template<typename TChar> class TStringNZT;
38
39 template<typename TChar> struct TNumberFormat;
40 template<typename TChar> class TFormat;
41 template<typename TChar, typename TAllocator> class TStringLengthResetter;
42
43 /// This TMP struct is tested by implicit "auto cast" operators. Those might be disabled for
44 /// combinations of types.
45 ///
46 /// For example, implicit casting from class \b AString to sibling types \b CString and \b Substring
47 /// has to be forbidden, because both are also constructible implicitly from this class and hence an
48 /// ambiguity between implicit cast and implicit construction would arise.
49 ///
50 /// Custom classes might encounter similar problems. In that case, this TMP type may be specialized
51 /// to mitigate compilation issues.
52 ///
53 /// @tparam TFrom The type that allows implicit auto-casts.
54 /// @tparam TImOrExplict Denotes if implicit or explicit casts are suppressed.
55 /// @tparam TTo The destination type that auto-casts should be suppressed for.
56 /// @tparam TEnableIf Helper parameter used for templated specializations of this struct.
57 template<typename TFrom,
59 typename TTo,
60 typename TEnableIf =void>
61 struct T_SuppressAutoCast : public std::false_type {};
62
63} // namespace alib[::strings]
64
65// #################################################################################################
66// Alias names
67// #################################################################################################
68
69/// Type alias in namespace \b alib.
70using String = strings::TString <character>;
71
72/// Type alias in namespace \b alib.
73using ComplementString = strings::TString <complementChar>;
74
75/// Type alias in namespace \b alib.
76using StrangeString = strings::TString <strangeChar>;
77
78/// Type alias in namespace \b alib.
79using NString = strings::TString <nchar>;
80
81/// Type alias in namespace \b alib.
82using WString = strings::TString <wchar>;
83
84/// Type alias in namespace \b alib.
85using XString = strings::TString <xchar>;
86
87/// Type alias in namespace \b alib.
88using Substring = strings::TSubstring <character>;
89
90/// Type alias in namespace \b alib.
91using ComplementSubstring = strings::TSubstring <complementChar>;
92
93/// Type alias in namespace \b alib.
94using StrangeSubstring = strings::TSubstring <strangeChar>;
95
96/// Type alias in namespace \b alib.
97using NSubstring = strings::TSubstring <nchar>;
98
99/// Type alias in namespace \b alib.
100using WSubstring = strings::TSubstring <wchar>;
101
102/// Type alias in namespace \b alib.
103using XSubstring = strings::TSubstring <xchar>;
104
105/// Type alias in namespace \b alib.
106using CString = strings::TCString <character>;
107
108/// Type alias in namespace \b alib.
109using ComplementCString= strings::TCString <complementChar>;
110
111/// Type alias in namespace \b alib.
112using StrangeCString = strings::TCString <strangeChar>;
113
114/// Type alias in namespace \b alib.
115using NCString = strings::TCString <nchar>;
116
117/// Type alias in namespace \b alib.
118using WCString = strings::TCString <wchar>;
119
120/// Type alias in namespace \b alib.
121using XCString = strings::TCString <xchar>;
122
123DOX_MARKER( [DOX_MONOMEM_ALLOCMEMBER])
124/// Type alias in namespace \b alib.
125using AString= strings::TAString<character, lang::HeapAllocator>;
126DOX_MARKER( [DOX_MONOMEM_ALLOCMEMBER])
127
128/// Type alias in namespace \b alib.
129using ComplementAString= strings::TAString <complementChar , lang::HeapAllocator>;
130
131/// Type alias in namespace \b alib.
132using StrangeAString = strings::TAString <strangeChar , lang::HeapAllocator>;
133
134/// Type alias in namespace \b alib.
135using NAString = strings::TAString <nchar , lang::HeapAllocator>;
136
137/// Type alias in namespace \b alib.
138using WAString = strings::TAString <wchar , lang::HeapAllocator>;
139
140/// Type alias in namespace \b alib.
141using XAString = strings::TAString <xchar , lang::HeapAllocator>;
142
143/// Type alias in namespace \b alib.
144using StringNZT = strings::TStringNZT <character>;
145
146/// Type alias in namespace \b alib.
147using ComplementStringNZT= strings::TStringNZT <complementChar>;
148
149/// Type alias in namespace \b alib.
150using StrangeStringNZT = strings::TStringNZT <strangeChar>;
151
152/// Type alias in namespace \b alib.
153using NStringNZT = strings::TStringNZT <nchar>;
154
155/// Type alias in namespace \b alib.
156using WStringNZT = strings::TStringNZT <wchar>;
157
158/// Type alias in namespace \b alib.
159using XStringNZT = strings::TStringNZT <xchar>;
160
161/// Type alias in namespace \b alib.
162template<integer TCapacity>
163using LocalString = strings::TLocalString<character , TCapacity, lang::HeapAllocator>;
164
165/// Type alias in namespace \b alib.
166template<integer TCapacity>
167using ComplementLocalString= strings::TLocalString<complementChar, TCapacity, lang::HeapAllocator>;
168
169/// Type alias in namespace \b alib.
170template<integer TCapacity>
171using StrangeLocalString= strings::TLocalString<strangeChar , TCapacity, lang::HeapAllocator>;
172
173/// Type alias in namespace \b alib.
174template<integer TCapacity>
175using NLocalString = strings::TLocalString <nchar , TCapacity, lang::HeapAllocator>;
176
177/// Type alias in namespace \b alib.
178template<integer TCapacity>
179using WLocalString = strings::TLocalString <wchar , TCapacity, lang::HeapAllocator>;
180
181/// Type alias in namespace \b alib.
182template<integer TCapacity>
183using XLocalString = strings::TLocalString <xchar , TCapacity, lang::HeapAllocator>;
184
185/// Type alias name for \alib{strings;TLocalString;TLocalString<character,8>}.
187
188/// Type alias name for \alib{strings;TLocalString;TLocalString<character,16>}.
190
191/// Type alias name for \alib{strings;TLocalString;TLocalString<character,32>}.
193
194/// Type alias name for \alib{strings;TLocalString;TLocalString<character,64>}.
196
197/// Type alias name for \alib{strings;TLocalString;TLocalString<character,128>}.
199
200/// Type alias name for \alib{strings;TLocalString;TLocalString<character,256>}.
202
203/// Type alias name for \alib{strings;TLocalString;TLocalString<character,512>}.
205
206/// Type alias name for \alib{strings;TLocalString;TLocalString<character,1024>}.
207using String1K = LocalString<1024>;
208
209/// Type alias name for \alib{strings;TLocalString;TLocalString<character,2048>}.
210using String2K = LocalString<2048>;
211
212/// Type alias name for \alib{strings;TLocalString;TLocalString<character,4096>}.
213using String4K = LocalString<4096>;
214
215/// Type alias name for \alib{strings;TLocalString;TLocalString<character,8192>}.
216using String8K = LocalString<8192>;
217
218/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,8>}.
220
221/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,16>}.
223
224/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,32>}.
226
227/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,64>}.
229
230/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,128>}.
232
233/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,256>}.
235
236/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,512>}.
238
239/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,1024>}.
241
242/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,2048>}.
244
245/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,8192>}.
247
248/// Type alias name for \alib{strings;TLocalString;TLocalString<nchar,4096>}.
250
251/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,8>}.
253
254/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,16>}.
256
257/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,32>}.
259
260/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,64>}.
262
263/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,128>}.
265
266/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,256>}.
268
269/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,512>}.
271
272/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,1024>}.
274
275/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,2048>}.
277
278/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,4096>}.
280
281/// Type alias name for \alib{strings;TLocalString;TLocalString<wchar,8192>}.
283
284
285/// Type alias in namespace \b alib.
286using NumberFormat = strings::TNumberFormat<character>;
287
288/// Type alias in namespace \b alib.
289using ComplementNumberFormat=strings::TNumberFormat<complementChar>;
290
291/// Type alias in namespace \b alib.
292using StrangeNumberFormat= strings::TNumberFormat<strangeChar>;
293
294/// Type alias in namespace \b alib.
295using NNumberFormat = strings::TNumberFormat<nchar>;
296
297/// Type alias in namespace \b alib.
298using WNumberFormat = strings::TNumberFormat<wchar>;
299
300/// Type alias in namespace \b alib.
301using XNumberFormat = strings::TNumberFormat<xchar>;
302
303
304/// Type alias in namespace \b alib.
305using Format = strings::TFormat<character>;
306
307/// Type alias in namespace \b alib.
308using ComplementFormat = strings::TFormat<complementChar >;
309
310/// Type alias in namespace \b alib.
311using StrangeFormat = strings::TFormat<strangeChar >;
312
313/// Type alias in namespace \b alib.
314using NFormat = strings::TFormat<nchar>;
315
316/// Type alias in namespace \b alib.
317using WFormat = strings::TFormat<wchar>;
318
319/// Type alias in namespace \b alib.
320using XFormat = strings::TFormat<xchar>;
321
322/// Type alias in namespace \b alib.
323using StringLengthResetter = strings::TStringLengthResetter<character ,lang::HeapAllocator>;
324
325/// Type alias in namespace \b alib.
326using ComplementStringLengthResetter= strings::TStringLengthResetter<complementChar,lang::HeapAllocator>;
327
328/// Type alias in namespace \b alib.
329using StrangeStringLengthResetter = strings::TStringLengthResetter<strangeChar ,lang::HeapAllocator>;
330
331/// Type alias in namespace \b alib.
332using NStringLengthResetter = strings::TStringLengthResetter<nchar ,lang::HeapAllocator>;
333
334/// Type alias in namespace \b alib.
335using WStringLengthResetter = strings::TStringLengthResetter<wchar ,lang::HeapAllocator>;
336
337/// Type alias in namespace \b alib.
338using XStringLengthResetter = strings::TStringLengthResetter<xchar ,lang::HeapAllocator>;
339
340} // namespace [alib]
341
342
343// #################################################################################################
344// Macros
345// #################################################################################################
346
347#if !ALIB_CHARACTERS_WIDE
348# define ALIB_STRINGS_TO_NARROW( src,dest,bufSize ) decltype(src)& dest(src);
349# define ALIB_STRINGS_TO_NARROW_ARG( src,bufSize ) src;
350# define ALIB_STRINGS_TO_WIDE( src,dest,bufSize ) alib::strings::TLocalString<wchar,bufSize> dest(src);
351# define ALIB_STRINGS_TO_WIDE_ARG( src,bufSize ) alib::strings::TLocalString<wchar,bufSize>(src);
352# define ALIB_STRINGS_FROM_NARROW( src,dest,bufSize ) decltype(src)& dest(src);
353# define ALIB_STRINGS_FROM_NARROW_ARG( src,bufSize ) src;
354# define ALIB_STRINGS_FROM_WIDE( src,dest,bufSize ) alib::strings::TLocalString<nchar,bufSize> dest(src);
355# define ALIB_STRINGS_FROM_WIDE_ARG src,bufSize ) alib::strings::TLocalString<nchar,bufSize>(src);
356#else
357# define ALIB_STRINGS_TO_NARROW( src,dest,bufSize ) alib::strings::TLocalString<nchar,bufSize> dest(src);
358# define ALIB_STRINGS_TO_NARROW_ARG( src,bufSize ) alib::strings::TLocalString<nchar,bufSize>(src);
359# define ALIB_STRINGS_TO_WIDE( src,dest,bufSize ) decltype(src)& dest= src;
360# define ALIB_STRINGS_TO_WIDE_ARG( src,bufSize ) src;
361# define ALIB_STRINGS_FROM_NARROW( src,dest,bufSize ) alib::strings::TLocalString<wchar,bufSize> dest(src);
362# define ALIB_STRINGS_FROM_NARROW_ARG( src,bufSize ) alib::strings::TLocalString<wchar,bufSize>(src);
363# define ALIB_STRINGS_FROM_WIDE( src,dest,bufSize ) decltype(src)& dest= src;
364# define ALIB_STRINGS_FROM_WIDE_ARG( src,bufSize ) src;
365#endif
366
367
368
369#endif // HPP_ALIB_STRINGS_FWDS
370
Definition alib.cpp:69
characters::complementChar complementChar
Type alias in namespace alib.
characters::wchar wchar
Type alias in namespace alib.
characters::xchar xchar
Type alias in namespace alib.
characters::strangeChar strangeChar
Type alias in namespace alib.
characters::character character
Type alias in namespace alib.
characters::nchar nchar
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
Definition integers.hpp:273