ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
strings_monomem.mpp
Go to the documentation of this file.
1//==================================================================================================
2/// \file
3/// This header-file is part of the \aliblong.
4/// With supporting legacy or module builds, .mpp-files are either recognized by the build-system
5/// as C++20 Module interface files, or are included by the
6/// \ref alib_manual_modules_impludes "import/include headers".
7///
8/// \emoji :copyright: 2013-2025 A-Worx GmbH, Germany.
9/// Published under \ref mainpage_license "Boost Software License".
10//==================================================================================================
11#if !defined(ALIB_C20_MODULES) || ((ALIB_C20_MODULES != 0) && (ALIB_C20_MODULES != 1))
12# error "Symbol ALIB_C20_MODULES has to be given to the compiler as either 0 or 1"
13#endif
14#if ALIB_C20_MODULES
15 module;
16#endif
17// ====================================== Global Fragment ======================================
19
20#include <iterator>
21#include <cmath>
22#include <algorithm>
23
24#if defined( _WIN32 ) || defined(__APPLE__)
25# include <clocale>
26#endif
27#if defined(_WIN32)
28# include <intrin.h>
29#endif
30#include <clocale>
31#include <limits>
32#include <vector>
33#include <algorithm>
34
35// =========================================== Module ==========================================
36#if ALIB_C20_MODULES
37 /// This is a C++ Module of the \aliblong. Due to the dual-compile option - as either
38 /// C++20 Modules or legacy C++ inclusion, the C++20 Module names are not of further interest
39 /// or use.<br>
40 /// In general, the names equal the names of the header files listed in the chapter
41 /// \ref alib_manual_modules_impludes of the \alib User Manual.
42 /// This chapter, among others, provides further explanations.
43 export module ALib.Strings.Monomem;
44 import ALib.Lang;
45 import ALib.Time;
46# if ALIB_MONOMEM
47 import ALib.Monomem;
48# endif
49# if ALIB_STRINGS
50 import ALib.Strings;
51# endif
52#else
53#include "ALib.Lang.H"
54#include "ALib.Time.H"
55#include "ALib.Monomem.H"
56#include "ALib.Strings.H"
57#endif
58
59// ========================================== Exports ==========================================
60
61//==================================================================================================
62//==== AString versions using Mono- and PoolAllocator
63//==================================================================================================
64#if !DOXYGEN
65
66#define ALIB_STRINGS_TASTRING_INSTANTIATION
67
68// AStringMA
69#define ASTR_TALLOC_SPEC MonoAllocator
70#define ASTR_TCHAR_SPEC ALIB_CHAR_TYPE_ID_W
72
73#define ASTR_TALLOC_SPEC MonoAllocator
74#define ASTR_TCHAR_SPEC ALIB_CHAR_TYPE_ID_N
76
77// AStringMA
78#define ASTR_TALLOC_SPEC PoolAllocator
79#define ASTR_TCHAR_SPEC ALIB_CHAR_TYPE_ID_W
81
82#define ASTR_TALLOC_SPEC PoolAllocator
83#define ASTR_TCHAR_SPEC ALIB_CHAR_TYPE_ID_N
85
86#endif
87
88ALIB_EXPORT namespace alib {
89
90/// Type alias in namespace \b alib.
92
93/// Type alias in namespace \b alib.
95
96/// Type alias in namespace \b alib.
98
99/// Type alias in namespace \b alib.
101
102/// Type alias in namespace \b alib.
104
105/// Type alias in namespace \b alib.
107
108/// Type alias in namespace \b alib.
110
111/// Type alias in namespace \b alib.
113
114/// Type alias in namespace \b alib.
116
117/// Type alias in namespace \b alib.
119
120/// Type alias in namespace \b alib.
122
123/// Type alias in namespace \b alib.
125
126/// Type alias in namespace \b alib.
127template<integer TCapacity>
129
130/// Type alias in namespace \b alib.
131template<integer TCapacity>
132using NLocalStringMA = strings::TLocalString <nchar , TCapacity, MonoAllocator>;
133
134/// Type alias in namespace \b alib.
135template<integer TCapacity>
136using WLocalStringMA = strings::TLocalString <wchar , TCapacity, MonoAllocator>;
137
138/// Type alias name for \alib{strings;TLocalString;TLocalString<character,8,MonoAllocator>}.
140
141/// Type alias name for \alib{strings;TLocalString;TLocalString<character,16,MonoAllocator>}.
143
144/// Type alias name for \alib{strings;TLocalString;TLocalString<character,32,MonoAllocator>}.
146
147/// Type alias name for \alib{strings;TLocalString;TLocalString<character,64,MonoAllocator>}.
149
150/// Type alias name for \alib{strings;TLocalString;TLocalString<character,128,MonoAllocator>}.
152
153/// Type alias name for \alib{strings;TLocalString;TLocalString<character,256,MonoAllocator>}.
155
156/// Type alias name for \alib{strings;TLocalString;TLocalString<character,512,MonoAllocator>}.
158
159/// Type alias name for \alib{strings;TLocalString;TLocalString<character,1024,MonoAllocator>}.
161
162/// Type alias name for \alib{strings;TLocalString;TLocalString<character,2048,MonoAllocator>}.
164
165/// Type alias name for \alib{strings;TLocalString;TLocalString<character,4096,MonoAllocator>}.
167
168/// Type alias in namespace \b alib.
169template<integer TCapacity>
171
172/// Type alias in namespace \b alib.
173template<integer TCapacity>
174using NLocalStringPA = strings::TLocalString <nchar , TCapacity, PoolAllocator>;
175
176/// Type alias in namespace \b alib.
177template<integer TCapacity>
178using WLocalStringPA = strings::TLocalString <wchar , TCapacity, PoolAllocator>;
179
180/// Type alias name for \alib{strings;TLocalString;TLocalString<character,8,PoolAllocator>}.
182
183/// Type alias name for \alib{strings;TLocalString;TLocalString<character,16,PoolAllocator>}.
185
186/// Type alias name for \alib{strings;TLocalString;TLocalString<character,32,PoolAllocator>}.
188
189/// Type alias name for \alib{strings;TLocalString;TLocalString<character,64,PoolAllocator>}.
191
192/// Type alias name for \alib{strings;TLocalString;TLocalString<character,128,PoolAllocator>}.
194
195/// Type alias name for \alib{strings;TLocalString;TLocalString<character,256,PoolAllocator>}.
197
198/// Type alias name for \alib{strings;TLocalString;TLocalString<character,512,PoolAllocator>}.
200
201/// Type alias name for \alib{strings;TLocalString;TLocalString<character,1024,PoolAllocator>}.
203
204/// Type alias name for \alib{strings;TLocalString;TLocalString<character,2048,PoolAllocator>}.
206
207/// Type alias name for \alib{strings;TLocalString;TLocalString<character,4096,PoolAllocator>}.
209
210} // namespace [alib]
211
212//==================================================================================================
213//==== Debug-features in namespace alib::monomem
214//==================================================================================================
215#if ALIB_DEBUG
216ALIB_EXPORT namespace alib::monomem {
217 //==========================================================================================
218 /// Provides allocation statistics for manual performance optimization.
219 ///
220 /// \par Availability
221 /// This method is included only in debug-compilations and when module \alib_strings is
222 /// included in the \alibbuild.<br>
223 /// In case the code selector symbol \ref ALIB_DEBUG_MEMORY is set, additional information
224 /// retrieved with \alib{monomem;TMonoAllocator::DbgGetStatistics} is included in the
225 /// generated string.
226 ///
227 /// @param ma The allocator to get formatted statistics for.
228 /// @return Some textual information on the allocation statistics.
229 //==========================================================================================
230 template<typename TAllocator>
232
233// ############################# Template instantiation declaration ############################
234#if !DOXYGEN
236#endif
237
238} // namespace [alib::monomem]
239#endif // ALIB_DEBUG
240
241
#define ALIB_DLL
Definition alib.inl:496
#define ALIB_EXPORT
Definition alib.inl:488
NAString DbgDumpStatistics(monomem::TMonoAllocator< TAllocator > &ma)
LocalStringMA< 64 > StringMA64
Type alias name for TLocalString<character,64,MonoAllocator>.
LocalStringPA< 32 > StringPA32
Type alias name for TLocalString<character,32,PoolAllocator>.
strings::TLocalString< nchar, TCapacity, MonoAllocator > NLocalStringMA
Type alias in namespace alib.
strings::TAString< wchar, PoolAllocator > WAStringPA
Type alias in namespace alib.
LocalStringMA< 128 > StringMA128
Type alias name for TLocalString<character,128,MonoAllocator>.
LocalStringMA< 2048 > StringMA2K
Type alias name for TLocalString<character,2048,MonoAllocator>.
strings::TLocalString< nchar, TCapacity, PoolAllocator > NLocalStringPA
Type alias in namespace alib.
strings::TLocalString< character, TCapacity, MonoAllocator > LocalStringMA
Type alias in namespace alib.
LocalStringPA< 16 > StringPA16
Type alias name for TLocalString<character,16,PoolAllocator>.
LocalStringPA< 128 > StringPA128
Type alias name for TLocalString<character,128,PoolAllocator>.
strings::TStringLengthResetter< nchar, PoolAllocator > NStringPALengthResetter
Type alias in namespace alib.
LocalStringMA< 1024 > StringMA1K
Type alias name for TLocalString<character,1024,MonoAllocator>.
strings::TStringLengthResetter< wchar, PoolAllocator > WStringPALengthResetter
Type alias in namespace alib.
strings::TLocalString< character, TCapacity, PoolAllocator > LocalStringPA
Type alias in namespace alib.
LocalStringMA< 4096 > StringMA4K
Type alias name for TLocalString<character,4096,MonoAllocator>.
strings::TAString< wchar, MonoAllocator > WAStringMA
Type alias in namespace alib.
LocalStringMA< 32 > StringMA32
Type alias name for TLocalString<character,32,MonoAllocator>.
strings::TAString< nchar, lang::HeapAllocator > NAString
Type alias in namespace alib.
LocalStringPA< 8 > StringPA8
Type alias name for TLocalString<character,8,PoolAllocator>.
LocalStringMA< 512 > StringMA512
Type alias name for TLocalString<character,512,MonoAllocator>.
LocalStringMA< 8 > StringMA8
Type alias name for TLocalString<character,8,MonoAllocator>.
strings::TStringLengthResetter< character, MonoAllocator > StringMALengthResetter
Type alias in namespace alib.
LocalStringMA< 16 > StringMA16
Type alias name for TLocalString<character,16,MonoAllocator>.
strings::TLocalString< wchar, TCapacity, PoolAllocator > WLocalStringPA
Type alias in namespace alib.
strings::TAString< nchar, PoolAllocator > NAStringPA
Type alias in namespace alib.
strings::TAString< nchar, MonoAllocator > NAStringMA
Type alias in namespace alib.
strings::TAString< character, MonoAllocator > AStringMA
Type alias in namespace alib.
LocalStringMA< 256 > StringMA256
Type alias name for TLocalString<character,256,MonoAllocator>.
strings::TAString< character, PoolAllocator > AStringPA
Type alias in namespace alib.
LocalStringPA< 4096 > StringPA4K
Type alias name for TLocalString<character,4096,PoolAllocator>.
LocalStringPA< 256 > StringPA256
Type alias name for TLocalString<character,256,PoolAllocator>.
strings::TStringLengthResetter< character, PoolAllocator > StringPALengthResetter
Type alias in namespace alib.
LocalStringPA< 1024 > StringPA1K
Type alias name for TLocalString<character,1024,PoolAllocator>.
LocalStringPA< 512 > StringPA512
Type alias name for TLocalString<character,512,PoolAllocator>.
LocalStringPA< 64 > StringPA64
Type alias name for TLocalString<character,64,PoolAllocator>.
LocalStringPA< 2048 > StringPA2K
Type alias name for TLocalString<character,2048,PoolAllocator>.
strings::TStringLengthResetter< nchar, MonoAllocator > NStringMALengthResetter
Type alias in namespace alib.
strings::TLocalString< wchar, TCapacity, MonoAllocator > WLocalStringMA
Type alias in namespace alib.
strings::TStringLengthResetter< wchar, MonoAllocator > WStringMALengthResetter
Type alias in namespace alib.