ALib C++ Library
Library Version: 2511 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 <em><b>C++ Module</b></em> of the \aliblong.
38 /// Due to the dual-compile option (either as C++20 Modules or using legacy C++ inclusion),
39 /// the C++20 Module names are not of further interest 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 ///
43 /// @see The documentation of the <em><b>"ALib Module"</b></em> given with the corresponding
44 /// Programmer's Manual \alib_strings.
45 export module ALib.Strings.Monomem;
46 import ALib.Lang;
47 import ALib.Time;
48# if ALIB_MONOMEM
49 import ALib.Monomem;
50# endif
51# if ALIB_STRINGS
52 import ALib.Strings;
53# endif
54#else
55#include "ALib.Lang.H"
56#include "ALib.Time.H"
57#include "ALib.Monomem.H"
58#include "ALib.Strings.H"
59#endif
60
61//============================================= Exports ============================================
62
63//==================================================================================================
64//==== AString versions using Mono- and PoolAllocator
65//==================================================================================================
66#if !DOXYGEN
67
68#define ALIB_STRINGS_TASTRING_INSTANTIATION
69
70// AStringMA
71#define ASTR_TALLOC_SPEC MonoAllocator
72#define ASTR_TCHAR_SPEC ALIB_CHAR_TYPE_ID_W
74
75#define ASTR_TALLOC_SPEC MonoAllocator
76#define ASTR_TCHAR_SPEC ALIB_CHAR_TYPE_ID_N
78
79// AStringMA
80#define ASTR_TALLOC_SPEC PoolAllocator
81#define ASTR_TCHAR_SPEC ALIB_CHAR_TYPE_ID_W
83
84#define ASTR_TALLOC_SPEC PoolAllocator
85#define ASTR_TCHAR_SPEC ALIB_CHAR_TYPE_ID_N
87
88#endif
89
90ALIB_EXPORT namespace alib {
91
92/// Type alias in namespace \b alib.
94
95/// Type alias in namespace \b alib.
97
98/// Type alias in namespace \b alib.
100
101/// Type alias in namespace \b alib.
103
104/// Type alias in namespace \b alib.
106
107/// Type alias in namespace \b alib.
109
110/// Type alias in namespace \b alib.
112
113/// Type alias in namespace \b alib.
115
116/// Type alias in namespace \b alib.
118
119/// Type alias in namespace \b alib.
121
122/// Type alias in namespace \b alib.
124
125/// Type alias in namespace \b alib.
127
128/// Type alias in namespace \b alib.
129template<integer TCapacity>
131
132/// Type alias in namespace \b alib.
133template<integer TCapacity>
134using NLocalStringMA = strings::TLocalString <nchar , TCapacity, MonoAllocator>;
135
136/// Type alias in namespace \b alib.
137template<integer TCapacity>
138using WLocalStringMA = strings::TLocalString <wchar , TCapacity, MonoAllocator>;
139
140/// Type alias name for \alib{strings;TLocalString;TLocalString<character,8,MonoAllocator>}.
142
143/// Type alias name for \alib{strings;TLocalString;TLocalString<character,16,MonoAllocator>}.
145
146/// Type alias name for \alib{strings;TLocalString;TLocalString<character,32,MonoAllocator>}.
148
149/// Type alias name for \alib{strings;TLocalString;TLocalString<character,64,MonoAllocator>}.
151
152/// Type alias name for \alib{strings;TLocalString;TLocalString<character,128,MonoAllocator>}.
154
155/// Type alias name for \alib{strings;TLocalString;TLocalString<character,256,MonoAllocator>}.
157
158/// Type alias name for \alib{strings;TLocalString;TLocalString<character,512,MonoAllocator>}.
160
161/// Type alias name for \alib{strings;TLocalString;TLocalString<character,1024,MonoAllocator>}.
163
164/// Type alias name for \alib{strings;TLocalString;TLocalString<character,2048,MonoAllocator>}.
166
167/// Type alias name for \alib{strings;TLocalString;TLocalString<character,4096,MonoAllocator>}.
169
170/// Type alias in namespace \b alib.
171template<integer TCapacity>
173
174/// Type alias in namespace \b alib.
175template<integer TCapacity>
176using NLocalStringPA = strings::TLocalString <nchar , TCapacity, PoolAllocator>;
177
178/// Type alias in namespace \b alib.
179template<integer TCapacity>
180using WLocalStringPA = strings::TLocalString <wchar , TCapacity, PoolAllocator>;
181
182/// Type alias name for \alib{strings;TLocalString;TLocalString<character,8,PoolAllocator>}.
184
185/// Type alias name for \alib{strings;TLocalString;TLocalString<character,16,PoolAllocator>}.
187
188/// Type alias name for \alib{strings;TLocalString;TLocalString<character,32,PoolAllocator>}.
190
191/// Type alias name for \alib{strings;TLocalString;TLocalString<character,64,PoolAllocator>}.
193
194/// Type alias name for \alib{strings;TLocalString;TLocalString<character,128,PoolAllocator>}.
196
197/// Type alias name for \alib{strings;TLocalString;TLocalString<character,256,PoolAllocator>}.
199
200/// Type alias name for \alib{strings;TLocalString;TLocalString<character,512,PoolAllocator>}.
202
203/// Type alias name for \alib{strings;TLocalString;TLocalString<character,1024,PoolAllocator>}.
205
206/// Type alias name for \alib{strings;TLocalString;TLocalString<character,2048,PoolAllocator>}.
208
209/// Type alias name for \alib{strings;TLocalString;TLocalString<character,4096,PoolAllocator>}.
211
212} // namespace [alib]
213
214//==================================================================================================
215//==== Debug-features in namespace alib::monomem
216//==================================================================================================
217#if ALIB_DEBUG
218ALIB_EXPORT namespace alib::monomem {
219//==================================================================================================
220/// Provides allocation statistics for manual performance optimization.
221///
222/// \par Availability
223/// This method is included only in debug-compilations and when module \alib_strings is
224/// included in the \alibbuild.<br>
225/// In case the code selector symbol \ref ALIB_DEBUG_MEMORY is set, additional information
226/// retrieved with \alib{monomem;TMonoAllocator::DbgGetStatistics} is included in the
227/// generated string.
228///
229/// @param ma The allocator to get formatted statistics for.
230/// @return Some textual information on the allocation statistics.
231//==================================================================================================
232template<typename TAllocator>
234
235//################################ Template instantiation declaration ##############################
236#if !DOXYGEN
238#endif
239
240} // namespace [alib::monomem]
241#endif // ALIB_DEBUG
#define ALIB_DLL
Definition alib.inl:503
#define ALIB_EXPORT
Definition alib.inl:497
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.