ALib C++ Framework
by
Library Version: 2605 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
chartraits.hpp
Go to the documentation of this file.
1//==================================================================================================
2/// \file
3/// This header-file is part of module \alib_characters of the \aliblong.
4///
5/// Copyright 2013-2026 A-Worx GmbH, Germany.
6/// Published under #"mainpage_license".
7//==================================================================================================
9
10/// Enumeration of possible values for fields \b Access" and \b Construction of traits-types
11/// #"ArrayTraits" and #"ZTArrayTraits".
12/// The elements of this enumeration indicate if and how the data of a "char-array-like type"
13/// (which may be non-zero- or zero-terminated) may be accessed and, reversely, how such types
14/// may be constructed from character arrays.
15///
16/// This is best explained when looking at class #"TString" of higher-level
17/// module \alib_strings.
18/// That classes' constructors use this policy to decide if an instance it may be constructed
19/// implicitly or explicitly from a third-party type.
20/// In the other direction, the type provides cast methods, which let instances of #"%TString"
21/// implicitly or explicitly convert into third-party types.
22enum class Policy {
23 /// Data may not be received, respectively the custom type may not be constructed from
24 /// a (character-array-) type.
25 /// This value usually indicates that a custom type does not represent a character array at all.
26 /// Hence, this is the default value exposed by the non-specialized version of type-traits
27 /// structs #"ArrayTraits" and #"ZTArrayTraits".
29
30 /// Allows implicit (and explicit) access of the character array data, respectively allows
31 /// implicit and explicit construction of string-like custom types, from mutable or constant
32 /// objects.
34
35 /// Allows explicit access of the character array data respectively allows
36 /// explicit construction of string-like custom types, from mutable or constant objects.
38
39 /// Allows explicit access of the character array data from mutable objects only.<br>
40 /// With the field \b Construction of traits-types #"ArrayTraits" and #"ZTArrayTraits", this
41 /// enumeration element is not used.
43};
44
45//==================================================================================================
46/// This type provides type-traits for character arrays. Specializations of this struct for
47/// a custom type \p{TStringSource}, expose information about that type representing a character
48/// array and how the array data may be accessed.<br>
49/// In addition, information about how the type may be constructed from character array data
50/// may be provided with specializations of this type.
51///
52/// \see
53/// For detailed information, see chapter #"alib_characters_arrays" of
54/// the Programmer's Manual of module \alib_characters.
55///
56/// @tparam TStringSource The type for which specializations of this struct provide array type-traits.
57/// @tparam TChar The character type of the character array that specializations provide
58/// type-traits for.
59//==================================================================================================
60template<typename TStringSource, typename TChar>
62 /// Provides information about how the character array data of instances of type
63 /// \p{TStringSource} may be accessed
64 static constexpr Policy Access = Policy::NONE;
65
66 /// Provides information about if and how instances of type \p{TStringSource} may be created
67 /// from character array data.
68 static constexpr Policy Construction = Policy::NONE;
69
70 #if DOXYGEN
71 /// In specialized versions, this method has to be provided in case that field #".Access" is
72 /// not equal to #"Policy::NONE;*".
73 /// In addition to this static method, sibling method #".Length" has to be provided.
74 ///
75 /// For example, in a specialization for standard C++ class \c std::string, this method returns
76 /// the result of method <c>std::string::data()</c>.
77 ///
78 /// Note that in the case of access type #"Policy::MutableOnly;*", the
79 /// signature of this method needs to be slightly different with the specialization: argument
80 /// \p{src} in this case must be of type <c>TStringSource&</c>, hence must not be \c const.
81 ///
82 /// @param src The source object of external type \p{TStringSource}.
83 /// @returns Specializations have to return a pointer to the start of the character array
84 /// represented by the given object \p{src} of type \p{TStringSource}.
85 static
86 const TChar* Buffer( const TStringSource& src );
87
88 /// In specialized versions, this method has to be provided in case that field #".Access" is
89 /// not equal to #"Policy::NONE;*".
90 /// In addition to this static method, sibling method #"Buffer" has to be provoided.
91 ///
92 /// For example, in a specialization for standard C++ class \c std::string, this method returns
93 /// the result of method <c>std::string::size()</c>.
94 ///
95 /// Note, that in the case of access type #"Policy::MutableOnly;*", the
96 /// signature of this method needs to be slightly different with the specialization: argument
97 /// \p{src} in this case must be of type <c>TStringSource&</c>, hence must not be \c const.
98 ///
99 /// @param src The source object of external type \p{TStringSource}.
100 /// @returns Specializations have to return the length of the character array
101 /// represented by the given object \p{src} of type \p{TStringSource}.
102 static
103 integer Length( const TStringSource& src );
104
105 /// In specialized versions, this method has to be provided in case that field #".Construction"
106 /// is not equal to #"Policy::NONE;*".
107 ///
108 /// If so, this method needs to construct and return an instance of type \p{TStringSource}, created
109 /// from the character array specified by arguments \p{array} and \p{length}
110 ///
111 /// @param array The external array to be used to create the return value.
112 /// @param length The length of the external array.
113 /// @returns A new instance (value) of type \p{TStringSource}.
114 static
115 TStringSource Construct( const TChar* array, integer length );
116 #endif
117};
118
119//==================================================================================================
120/// This type trait is in all aspects equivalent to #"ArrayTraits", only that
121/// this struct provides traits on zero-terminated character arrays, while #"%ArrayTraits" is
122/// about non-zero-terminated arrays.
123///
124/// Please, therefore consult the documentation of type #"ArrayTraits".
125///
126/// \see
127/// For detailed information, see chapter #"alib_characters_arrays" of
128/// the Programmer's Manual of module \alib_characters.
129///
130/// @tparam TStringSource The type for which specializations of this struct provide array type-traits.
131/// @tparam TChar The character type of the character array that specializations provide
132/// type-traits for.
133//==================================================================================================
134template<typename TStringSource, typename TChar>
136 /// Provides information about how the zero-terminated character arrays of instances of
137 /// type \p{TStringSource} may be accessed.
138 static constexpr Policy Access = Policy::NONE;
139
140 /// Provides information about if and how instances of type \p{TStringSource} may be created
141 /// from zero-terminated character arrays.
142 static constexpr Policy Construction = Policy::NONE;
143
144 #if DOXYGEN
145 /// Same as corresponding method #"ArrayTraits::Buffer" of sibling struct
146 /// #"%ArrayTraits".
147 ///
148 /// @param src The source object of external type \p{TStringSource}.
149 /// @returns Specializations have to return a pointer to the start of the zero-terminated
150 /// character array represented by the given object \p{src} of type \p{TStringSource}.
151 static
152 const TChar* Buffer( const TStringSource& src );
153
154 /// Same as corresponding method #"ArrayTraits::Length" of sibling struct
155 /// #"%ArrayTraits".
156 ///
157 /// @param src The source object of external type \p{TStringSource}.
158 /// @returns Specializations have to return the length of the character array
159 /// represented by the given object \p{src} of type \p{TStringSource}.
160 static
161 integer Length( const TStringSource& src );
162
163 /// Same as corresponding method #"ArrayTraits::Construct" of sibling struct
164 /// #"%ArrayTraits".
165 ///
166 /// @param array The external zero-terminated array to be used to create the return value.
167 /// @param length The length of the external array.
168 /// @returns A new instance (value) of type \p{TStringSource}.
169 static
170 TStringSource Construct( const TChar* array, integer length );
171 #endif
172}; // struct ZTArrayTraits
173
174
176//==================================================================================================
177/// Concept which is satisfied for given template type \p{T} in case a specialization of
178/// the type trait #"ArrayTraits;ArrayTraits<T, TChar>" exists.
179///
180/// \see
181/// - For details see chapter #"alib_characters_arrays_traits_tool_arraytype" of
182/// the Programmer's Manual of module \alib_characters_nl.
183/// - Type alias {characters;CharType}.
184/// - A sibling concept exists with concept #"IsZTArray".
185///
186/// @tparam T The custom type to test for being or incorporating a character array.
187/// @tparam TChar The character type of the array to test for.
188//==================================================================================================
189template<typename T, typename TChar>
191
192//==================================================================================================
193/// Determines the character type of the array that the given template type \p{T} represents.
194/// In case no a specialization of the type trait
195/// #"ArrayTraits;ArrayTraits<T, TChar>" exists, this evaluates to \c void.
196/// Otherwise, this alias evaluates to one of #"characters::nchar", #"characters::wchar"
197/// or #"characters::xchar".
198///
199/// \see
200/// - For details see chapter #"alib_characters_arrays_traits_tool_arraytype" of
201/// the Programmer's Manual of module \alib_characters_nl.
202/// - Concept #"ch IsArray".
203/// - A sibling alias exists with #"ZTType".
204///
205/// @tparam T The custom type to get the character type for.
206//==================================================================================================
207template<typename T>
208using Type= std::conditional_t<ArrayTraits<T,nchar>::Access != Policy::NONE, nchar,
209 std::conditional_t<ArrayTraits<T,wchar>::Access != Policy::NONE, wchar,
210 std::conditional_t<ArrayTraits<T,xchar>::Access != Policy::NONE, xchar,
211 void > > >;
212
213//==================================================================================================
214/// Concept which is satisfied for given template type \p{T} in case a specialization of
215/// the type trait #"ZTArrayTraits;ZTArrayTraits<T, TChar>" exists.
216///
217/// \see
218/// - For details see chapter #"alib_characters_arrays_traits_tool_arraytype" of
219/// the Programmer's Manual of module \alib_characters_nl.
220/// - Type alias #"ZTType".
221/// - A sibling concept exists with concept #"IsZTArray".
222///
223/// @tparam T The custom type to test for being or incorporating a zero-terminated character
224/// array.
225/// @tparam TChar The character type of the array to test for.
226//==================================================================================================
227template<typename T, typename TChar>
229
230/// Determines the character type of the zero-terminated array that the given template type
231/// \p{T} represents.
232/// In case no a specialization of the type trait
233/// #"ArrayTraits;ZTArrayTraits<T, TChar>" exists, this evaluates to \c void.
234/// Otherwise, this alias evaluates to one of #"characters::nchar", #"characters::wchar"
235/// or #"characters::xchar".
236///
237/// \see
238/// - For details see chapter #"alib_characters_arrays_traits_tool_arraytype" of
239/// the Programmer's Manual of module \alib_characters_nl.
240/// - Concept #"ch IsArray".
241/// - A sibling alias exists with #"ZTType".
242///
243/// @tparam T The custom type to get the character type for.
244template<typename T>
245using ZTType= std::conditional_t<ZTArrayTraits<T,nchar>::Access != Policy::NONE, nchar,
246 std::conditional_t<ZTArrayTraits<T,wchar>::Access != Policy::NONE, wchar,
247 std::conditional_t<ZTArrayTraits<T,xchar>::Access != Policy::NONE, xchar,
248 void > > >;
249
250/// A concept to identify types that can be used to \b implicitly construct string types.
251/// @see Traits class #"ArrayTraits" which may be specialized for custom types to
252/// satisfy this concept - with the aim to make type \p{T} compatible (exchangeable) with
253/// string types.
254/// @tparam T The type to be tested (with \c const and \c volatile removed).
255/// @tparam TChar The character type of the string type.
256template <typename T, typename TChar>
259
260/// A concept to identify types which can be used to\b explicitly construct string types.
261/// @see Traits class #"ArrayTraits" which may be specialized for custom types to
262/// satisfy this concept - with the aim to make type \p{T} compatible (exchangeable) with
263/// string types.
264/// @tparam T The type to be tested (with \c const and \c volatile removed).
265/// @tparam TChar The character type of the string type
266/// to be constructed.
267template <typename T, typename TChar>
270
271/// A concept to identify <b>non-const</b> types which can be used to\b explicitly construct
272/// string types.
273/// Used for explicit string construction, when the access-traits need to
274/// perform changes on the source object, which imply that those are mutable.
275/// @see Traits class #"ArrayTraits" which may be specialized for custom types to
276/// satisfy this concept - with the aim to make type \p{T} compatible (exchangeable) with
277/// string types.
278/// @tparam T The type to be tested (with \c const and \c volatile removed).
279/// @tparam TChar The character type of the string type
280/// to be constructed.
281template <typename T, typename TChar>
284 && !std::is_const_v<T>;
285
286/// A concept to identify types that string types can be \b implicitly cast to.
287/// In other words, types which are constructible from string types.
288/// @see Traits class #"ArrayTraits" which may be specialized for custom types to
289/// satisfy this concept - with the aim to make type \p{T} compatible (exchangeable) with
290/// string types.
291/// @tparam T The type to be tested (with \c const and \c volatile removed).
292/// @tparam TChar The character type of the string type that should be cast to \p{T}.
293template <typename T, typename TChar>
296
297/// A concept to identify types that string types can be \b implicitly cast to.
298/// In other words, types which are constructible from string types.
299/// @see Traits class #"ArrayTraits" which may be specialized for custom types to
300/// satisfy this concept - with the aim to make type \p{T} compatible (exchangeable) with
301/// string types.
302/// @tparam T The type to be tested (with \c const and \c volatile removed).
303/// @tparam TChar The character type of the string type that should be cast to \p{T}.
304template <typename T, typename TChar>
307
308/// A concept to identify types which can be used to \b implicitly construct zero-terminated
309/// strings.
310/// @see Traits class #"ZTArrayTraits" which may be specialized for custom types to
311/// satisfy this concept - with the aim to make type \p{T} compatible (exchangeable) with
312/// zero-terminated string types.
313/// @tparam T The type to be tested (with \c const and \c volatile removed).
314/// @tparam TChar The character type of the string type.
315template <typename T, typename TChar>
318
319/// A concept to identify types which can be used to\b explicitly construct zero-terminated
320/// strings.
321/// @see Traits class #"ZTArrayTraits" which may be specialized for custom types to
322/// satisfy this concept - with the aim to make type \p{T} compatible (exchangeable) with
323/// zero-terminated string types.
324/// @tparam T The type to be tested (with \c const and \c volatile removed).
325/// @tparam TChar The character type of the string type.
326template <typename T, typename TChar>
329
330/// A concept to identify <b>non-const</b> types which can be used to\b explicitly construct
331/// \alib #"TString;strings".
332/// Used for explicit string construction, when the access-traits need to
333/// perform changes on the source object, which imply that those are mutable.
334/// @see Traits class #"ZTArrayTraits" which may be specialized for custom types to
335/// satisfy this concept - with the aim to make type \p{T} compatible (exchangeable) with
336/// zero-terminated string types.
337/// @tparam T The type to be tested (with \c const and \c volatile removed).
338/// @tparam TChar The character type of the string type to be constructed.
339template <typename T, typename TChar>
342 && !std::is_const_v<T>;
343
344
345/// Same as #"IsImplicitZTArrayCast", but uses type-traits class
346/// #"ZTArrayTraits" instead of #"ArrayTraits".
347/// @tparam T The type to be tested (with \c const and \c volatile removed).
348/// @tparam TChar The character type of the zero-terminated string type that should be cast
349/// to \p{T}.
350template <typename T, typename TChar>
353
354/// Same as #"IsExplicitZTArrayCast", but uses type-traits class
355/// #"ZTArrayTraits" instead of #"ArrayTraits".
356/// @tparam T The type to be tested.
357/// @tparam TChar The character type of the zero-terminated string type that should be cast
358/// to \p{T}.
359template <typename T, typename TChar>
362
363
364ALIB_POP_ALLOWANCE // ignore docs due to clang not knowing concepts
365
366
367//##################################################################################################
368// Specializations of ArrayTraits and ZTArrayTraits for const and non-const character pointer types
369//##################################################################################################
370
371#if !DOXYGEN
372//--------------------------------------- Fixed length arrays --------------------------------------
373template<size_t TCapacity, typename TChar>
374struct ArrayTraits<TChar[TCapacity], TChar>
375{
376 static constexpr Policy Access = Policy::Implicit;
377 static constexpr const TChar* Buffer( TChar const (&src) [TCapacity] ) { return src; }
378 static constexpr integer Length( TChar const (& ) [TCapacity] ){ return TCapacity -1; }
379};
380
381template<size_t TCapacity, typename TChar>
382struct ZTArrayTraits<TChar[TCapacity], TChar>
383{
384 static constexpr Policy Access = Policy::Implicit;
385 static constexpr const TChar* Buffer( TChar const (&src) [TCapacity] ) { return src; }
386 static constexpr integer Length( TChar const (& ) [TCapacity] ){ return TCapacity -1; }
387};
388
389// C++20 type 'char8_t'
390template<size_t TCapacity>
391struct ArrayTraits<char8_t[TCapacity], nchar>
392{
393 static constexpr Policy Access = Policy::Implicit;
394 static constexpr const nchar* Buffer( char8_t const (&src) [TCapacity] ) { return reinterpret_cast<const nchar*>(src); }
395 static constexpr integer Length( char8_t const (& ) [TCapacity] ) { return TCapacity -1; }
396};
397
398template<size_t TCapacity>
399struct ZTArrayTraits<char8_t[TCapacity], nchar>
400{
401 static constexpr Policy Access = Policy::Implicit;
402 static constexpr const nchar* Buffer( char8_t const (&src) [TCapacity] ) { return reinterpret_cast<const nchar*>(src); }
403 static constexpr integer Length( char8_t const (& ) [TCapacity] ) { return TCapacity -1; }
404};
405
406
407//----------------------------------- constant character pointers ----------------------------------
408template<typename TChar> struct ArrayTraits<const TChar*, TChar> {
409 static constexpr Policy Access = Policy::Implicit;
410 static constexpr Policy Construction = Policy::ExplicitOnly;
411 static constexpr const TChar* Buffer(const TChar* const & src ) { return src; }
412 static constexpr integer Length(const TChar* const & src ) { return src ? integer( std::char_traits<TChar>::length(src) ) : 0; }
413 static constexpr const TChar* Construct(const TChar* array, integer ) { return array; }
414};
415
416template<typename TChar> struct ZTArrayTraits<const TChar*, TChar> {
417 static constexpr Policy Access = Policy::Implicit;
418 static constexpr Policy Construction = Policy::Implicit;
419 static constexpr const TChar* Buffer(const TChar* const & src ) { return src; }
420 static constexpr integer Length(const TChar* const & src ) { return src ? integer( std::char_traits<TChar>::length(src) ) : 0; }
421 static constexpr const TChar* Construct(const TChar* array, integer ) { return array; }
422};
423
424// C++20 type 'char8_t'
425template<> struct ArrayTraits<const char8_t*, nchar> {
426 static constexpr Policy Access = Policy::Implicit;
427 static constexpr Policy Construction = Policy::ExplicitOnly;
428 static const nchar* Buffer(const char8_t* const & src ) { return reinterpret_cast<const nchar*>(src); }
429 static constexpr integer Length(const char8_t* const & src ) { return src ? integer( std::char_traits<char8_t>::length(src) ) : 0; }
430 static const char8_t* Construct(const nchar* array, integer ) { return reinterpret_cast<const char8_t*>(array); }
431};
432
433template<> struct ZTArrayTraits<const char8_t*, nchar> {
434 static constexpr Policy Access = Policy::Implicit;
435 static constexpr Policy Construction = Policy::Implicit;
436 static const nchar* Buffer(const char8_t* const & src ) { return reinterpret_cast<const nchar*>(src); }
437 static constexpr integer Length(const char8_t* const & src ) { return src ? integer( std::char_traits<char8_t>::length(src) ) : 0; }
438 static const char8_t* Construct(const nchar* array, integer ) { return reinterpret_cast<const char8_t*>(array); }
439};
440
441//------------------------------------ mutable character pointers ----------------------------------
442template<typename TChar> struct ArrayTraits<TChar*, TChar> {
443 static constexpr Policy Access = Policy::ExplicitOnly;
444 static constexpr Policy Construction = Policy::ExplicitOnly;
445 static constexpr const TChar* Buffer( TChar* const & src ) { return src; }
446 static constexpr integer Length( TChar* const & src ) { return src ? integer( std::char_traits<TChar>::length(src) ) : 0; }
447 static constexpr TChar* Construct(const TChar* array, integer ) { return const_cast<TChar*>( array ); }
448};
449
450template<typename TChar> struct ZTArrayTraits<TChar*, TChar> {
451 static constexpr Policy Access = Policy::ExplicitOnly;
452 static constexpr Policy Construction = Policy::ExplicitOnly;
453 static constexpr const TChar* Buffer( TChar* const & src ) { return src; }
454 static constexpr integer Length( TChar* const & src ) { return src ? integer( std::char_traits<TChar>::length(src) ) : 0; }
455 static constexpr TChar* Construct(const TChar* array, integer ) { return const_cast<TChar*>( array ); }
456};
457
458// C++20 type 'char8_t'
459template<> struct ArrayTraits<char8_t*, nchar> {
460 static constexpr Policy Access = Policy::ExplicitOnly;
461 static constexpr Policy Construction = Policy::ExplicitOnly;
462 static const nchar* Buffer( char8_t* const & src ) { return reinterpret_cast<nchar*>(src); }
463 static constexpr integer Length( char8_t* const & src ) { return src ? integer( std::char_traits<char8_t>::length(src) ) : 0; }
464 static char8_t* Construct(const nchar* array, integer ) { return const_cast<char8_t*>( reinterpret_cast<const char8_t*>(array) ); }
465};
466
467template<> struct ZTArrayTraits<char8_t*, nchar> {
468 static constexpr Policy Access = Policy::ExplicitOnly;
469 static constexpr Policy Construction = Policy::ExplicitOnly;
470 static const nchar* Buffer( char8_t* const & src ) { return reinterpret_cast<nchar*>(src); }
471 static constexpr integer Length( char8_t* const & src ) { return src ? integer( std::char_traits<char8_t>::length(src) ) : 0; }
472 static char8_t* Construct(const nchar* array, integer ) { return const_cast<char8_t*>( reinterpret_cast<const char8_t*>(array) ); }
473};
474
475#endif
476
477//##################################################################################################
478// Tools
479//##################################################################################################
480
481//==================================================================================================
482/// This templated alias type-definition provides the "complement" to the given character type.
483/// By that, it is defined to <c>wchar</c> if type <c>nchar</c> is given and vice versa.
484///
485/// Note that for type #"characters::xchar", no complement is defined.
486/// For this type (and all other types), this alias evaluates to <c>void</c>.
487/// @tparam TChar The character type to get the complement for.
488//==================================================================================================
489template<typename TChar>
490using ComplementType= std::conditional_t<std::same_as<TChar, nchar>, wchar,
491 std::conditional_t<std::same_as<TChar, wchar>, nchar, void > >;
492
493
494//==================================================================================================
495/// This templated type alias can be used to determine the corresponding \alib character type
496/// from the size of the type. Typically (on common 64-bit platforms), this alias evaluates to:
497/// #"characters::nchar" if \p{TSizeOf} is given as \c 0. Values \c 2 and \c 4 evaluate to
498/// #"characters::wchar" or #"characters::xchar" depending on the compiler and platform.
499///
500/// As an example, the \https{QT Class Library,www.qt.io} uses a 2-byte character width,
501/// independent of compiler and platform. Therefore, to convert a \b QT character value to
502/// an \alib character value, the destination type is:
503///
504/// using qtChar= alib::characters::TypeBySize<2>;
505///
506/// @tparam TSizeOf The size of the required character type in bytes.
507//==================================================================================================
508template<size_t TSizeOf>
509using TypeBySize = std::conditional_t<TSizeOf == sizeof(nchar), nchar,
510 std::conditional_t<TSizeOf == sizeof(wchar), wchar,
511 std::conditional_t<TSizeOf == sizeof(xchar), xchar, void > > >;
512
513
515
516//==================================================================================================
517/// A concept to identify \alib character types #"characters::nchar", #"characters::wchar"
518/// and #"characters::xchar". For these three types the concept is satisfied.
519///
520/// @tparam T The type to test for being an \alib character type.
521//==================================================================================================
522template<typename T>
523concept IsCharacter= std::is_same_v<T,nchar>
524 || std::is_same_v<T,wchar>
525 || std::is_same_v<T,xchar>;
526
527//==================================================================================================
528/// Returns the length of C++ arrays like <c>std::extent</c>, but subtracts \c 1 if the
529/// array's element-type satisfies concept #"ch IsCharacter".
530/// (Thus, this "removes" the zero-termination character.)
531/// @tparam T The type to get the length for. Deduced by the compiler.
532/// @return In case of character-arrays, the string length. For other arrays the true length
533/// and \c 0 for non-array types.
534//==================================================================================================
535template<typename T>
536constexpr integer ArrayLength() {
537 if constexpr (!std::is_array_v<T>)
538 return 0;
539
540 using TChar= std::remove_cv_t<std::remove_pointer_t<std::decay_t<T>>>;
541 if constexpr( IsCharacter<TChar> )
542 return std::extent<T>::value - 1;
543 return std::extent<T>::value;
544}
545
547
548} // namespace [alib::character]
#define ALIB_ALLOW_DOCS
#define ALIB_POP_ALLOWANCE
#define ALIB_EXPORT
PLATFORM_SPECIFIC xchar
Definition chartypes.hpp:51
std::conditional_t< std::same_as< TChar, nchar >, wchar, std::conditional_t< std::same_as< TChar, wchar >, nchar, void > > ComplementType
integer Length(const TChar *cstring)
Definition functions.hpp:89
std::conditional_t< ArrayTraits< T, nchar >::Access !=Policy::NONE, nchar, std::conditional_t< ArrayTraits< T, wchar >::Access !=Policy::NONE, wchar, std::conditional_t< ArrayTraits< T, xchar >::Access !=Policy::NONE, xchar, void > > > Type
PLATFORM_SPECIFIC wchar
Definition chartypes.hpp:38
std::conditional_t< ZTArrayTraits< T, nchar >::Access !=Policy::NONE, nchar, std::conditional_t< ZTArrayTraits< T, wchar >::Access !=Policy::NONE, wchar, std::conditional_t< ZTArrayTraits< T, xchar >::Access !=Policy::NONE, xchar, void > > > ZTType
constexpr integer ArrayLength()
std::conditional_t< TSizeOf==sizeof(nchar), nchar, std::conditional_t< TSizeOf==sizeof(wchar), wchar, std::conditional_t< TSizeOf==sizeof(xchar), xchar, void > > > TypeBySize
lang::integer integer
Type alias in namespace #"%alib".
Definition integers.hpp:149
static constexpr Policy Access
static integer Length(const TStringSource &src)
static TStringSource Construct(const TChar *array, integer length)
static constexpr Policy Construction
static const TChar * Buffer(const TStringSource &src)
static constexpr Policy Construction
static constexpr Policy Access
static const TChar * Buffer(const TStringSource &src)
static TStringSource Construct(const TChar *array, integer length)
static integer Length(const TStringSource &src)