ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
chartypes.inl
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/// \emoji :copyright: 2013-2025 A-Worx GmbH, Germany.
6/// Published under #"mainpage_license".
7//==================================================================================================
8ALIB_EXPORT namespace alib { namespace characters {
9
10//##################################################################################################
11// Narrow type: nchar
12//##################################################################################################
13
14/// This type represents a narrow character in \alib. This is an alias for built-in C++
15/// type \c char.
16///
17/// \see
18/// For details, see chapter #"alib_characters_chars" of the
19/// Programmer's Manual of module \alib_characters_nl.
20using nchar= char;
21
22//##################################################################################################
23// Wide types: wchar, xchar
24//##################################################################################################
25
26
27#if DOXYGEN
28/// This type represents a wide character in \alib.
29/// Usually this is an alias for built-in C++ type \c wchar_t.
30/// As the width of the latter is compiler-specific (the width may vary with different compilers even
31/// on the same platform), the configuration macro #"ALIB_CHARACTERS_SIZEOF_WCHAR" may be used to
32/// manipulate its width.
33///
34///
35/// \see
36/// For details, see chapter #"alib_characters_chars" of the
37/// Programmer's Manual of module \alib_characters_nl.
38using wchar= PLATFORM_SPECIFIC;
39
40/// This type represents a second wide character type which has a width complementary to
41/// that of type #"characters::wchar": If \b %wchar is 2 bytes wide, then this type aliases
42/// \c char32_t and if its width is 4 bytes, this type aliases \c char16_t.
43///
44/// While together with types #"alib::nchar" and #"alib::wchar" it forms
45/// the group of "explicit character types", it is always identical to logical type
46/// #"alib::strangeChar".
47///
48/// \see
49/// For details, see chapter #"alib_characters_chars" of the
50/// Programmer's Manual of module \alib_characters_nl.
51using xchar = PLATFORM_SPECIFIC;
52
53#else // !DOXYGEN
54
55# if ALIB_CHARACTERS_SIZEOF_WCHAR == ALIB_SIZEOF_WCHAR_T
56# if ALIB_CHARACTERS_SIZEOF_WCHAR == 2
57 using wchar = wchar_t;
58 using xchar = char32_t;
59# else
60 using wchar = wchar_t;
61 using xchar = char16_t;
62# endif
63# else
64# if ALIB_CHARACTERS_SIZEOF_WCHAR == 2
65 using wchar = char16_t;
66 using xchar = wchar_t;
67# else
68 using wchar = char32_t;
69 using xchar = wchar_t;
70# endif
71# endif
72
73
74#endif // !DOXYGEN
75
76
77//##################################################################################################
78// Logical types: character, #"characters::complementChar" and strangeChar
79//##################################################################################################
80
81#if DOXYGEN
82/// This type represents a standard \alib character.
83/// The width (size) of a character is dependent on the platform and compilation flags.
84///
85/// This is why this type is called a "logical" type. The two other logical character types are
86/// #"characters::complementChar" and #".strangeChar".
87///
88/// \see
89/// For details, see chapter #"alib_characters_chars" of the
90/// Programmer's Manual of module \alib_characters_nl.
91using character= PLATFORM_SPECIFIC;
92
93/// This type represents a non-standard \alib character.
94/// If #"alib::character" is defined to implement a narrow character type, then this type
95/// implements a wide character and vice versa.
96/// Note, that the width of a wide character is not defined as well. It might be \c 2 or \c 4
97/// bytes wide.
98///
99/// This type is called a "logical" type. The two other logical character types are
100/// #".character" and #".strangeChar".
101///
102/// \see
103/// For details, see chapter #"alib_characters_chars" of the
104/// Programmer's Manual of module \alib_characters_nl.
105using complementChar= PLATFORM_SPECIFIC;
106
107/// Besides types #"ch character" and #"ch complementChar", this is the third
108/// logical character type defined by \alib.<br>
109/// independent of compiler defaults and optional the configuration macros provided, this type always
110/// is equivalent to type #"characters::xchar"
111///
112/// \see
113/// For details, see chapter #"alib_characters_chars" of the
114/// Programmer's Manual of module \alib_characters_nl.
115using strangeChar= PLATFORM_SPECIFIC;
116
117
118#elif !ALIB_CHARACTERS_WIDE
119 using character= nchar;
120 using complementChar= wchar;
121 using strangeChar= xchar;
122#else
123 using character= wchar;
124 using complementChar= nchar;
125 using strangeChar= xchar;
126#endif
127} // namespace alib[::character]
128
129
130/// Type alias in namespace \b alib.
132
133/// Type alias in namespace \b alib.
135
136/// Type alias in namespace \b alib.
138
139/// Type alias in namespace \b alib.
141
142/// Type alias in namespace \b alib.
144
145/// Type alias in namespace \b alib.
147
148} // namespace [alib]
#define ALIB_EXPORT
Definition alib.inl:562
PLATFORM_SPECIFIC xchar
Definition chartypes.inl:51
PLATFORM_SPECIFIC character
Definition chartypes.inl:91
PLATFORM_SPECIFIC strangeChar
PLATFORM_SPECIFIC complementChar
PLATFORM_SPECIFIC wchar
Definition chartypes.inl:38
characters::strangeChar strangeChar
Type alias in namespace alib.
characters::complementChar complementChar
Type alias in namespace alib.
characters::wchar wchar
Type alias in namespace alib.
characters::nchar nchar
Type alias in namespace alib.
characters::xchar xchar
Type alias in namespace alib.
characters::character character
Type alias in namespace alib.