ALib C++ Framework
by
Library Version: 2605 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
format.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/// Copyright 2013-2026 A-Worx GmbH, Germany.
6/// Published under #"mainpage_license".
7//==================================================================================================
8
9
10ALIB_EXPORT namespace alib { namespace strings {
11
12/// This is a type purely made to be #"alib_strings_assembly_ttostring;appended" to objects of
13/// type #"^AString".
14/// Various constructors accept integer and floating point values, along with formatting options.
15/// The specialization of functor #"AppendableTraits" will use a given (or defaulted)
16/// instance of class #"TNumberFormat;NumberFormat" to format the encapsulated value and
17/// append the result to the #"%AString" in question.
18///
19/// \note
20/// Within the same header-file that this class in declared in, there are several
21/// specializations of functor #"AppendableTraits" defined for plain integer and
22/// floating point types. These specializations create an object of this type, providing the
23/// value only, hence, using this classes constructor's default values. The number format
24/// used as default by the constructors of this class is
25/// #"TNumberFormat::Computational;NumberFormat::Computational".
26/// As a result, the application of such core types, as in:
27/// \snippet "DOX_ASTRING_APPEND.cpp" DOX_APPEND_FORMAT1
28/// which produces:
29/// \verbinclude "DOX_APPEND_FORMAT1.txt"
30///
31/// \note
32/// does \b not use a locale-specific number format. Instead, it uses one that is exchangeable
33/// between applications independent of the locale setting of the executing machine.<br>
34/// Consequently, for locale-specific output, an object of this class needs to be appended
35/// along with a locale enabled instance of #"%^NumberFormat". For example:
36/// \snippet "DOX_ASTRING_APPEND.cpp" DOX_APPEND_FORMAT2
37/// which - dependent on the current local setting - might produce:
38/// \verbinclude "DOX_APPEND_FORMAT2.txt"
39///
40///
41/// <b>Details on Formats:</b><br>
42/// Details on the options of formatting integer and floating point numbers are documented
43/// with class
44/// #"TNumberFormat;NumberFormat".
45///
46/// @tparam TChar The #"alib_characters_chars;character type" of the #"%AString" that
47/// instances can be "applied" to.
48template<typename TChar>
49class TDec {
50 public:
51 /// The union to hold an integral or floating point value provided with the different
52 /// constructors.
53 union {
54 int64_t value; ///< The value when using constructor with signed integer types.
55 double fpValue; ///< The value when using constructor with type double.
56 } v; ///< The data
57
58 TNumberFormat<TChar>* nf; ///< The number format to use. Defaults to \c nullptr which chooses
59 ///< the static singleton found in
60 ///< #"TNumberFormat::Computational;NumberFormat::Computational".
61
62 int width; ///< The minimum width of the number to write.
63 ///< Defaults to \c 0 which denotes to choose the value of field
64 ///< #"TNumberFormat::DecMinimumFieldWidth;NumberFormat::DecMinimumFieldWidth".
65 int valueType; ///< Flag witch value to use (1= sInt, 2=uInt, 3=fp )
66
67 /// Constructor. Stores parameters.
68 /// @tparam TIntegral The type of argument \p{value}. Deduced by the compiler.
69 /// Only integral values are accepted.
70 /// @param value The value to write.
71 /// @param overrideWidth Defaults to \c 0 which denotes to choose the value of field
72 /// #"TNumberFormat::DecMinimumFieldWidth;NumberFormat::DecMinimumFieldWidth".
73 /// @param numberFormat The number format to use.
74 /// Defaults to \c nullptr which chooses the static singleton found in
75 /// #"TNumberFormat::Computational;NumberFormat::Computational".
76 template<typename TIntegral>
77 requires std::integral<TIntegral>
78 TDec( TIntegral value,
79 int overrideWidth= 0,
80 TNumberFormat<TChar>* numberFormat = nullptr )
81 : nf (numberFormat)
82 , width (overrideWidth)
83 , valueType( std::numeric_limits<TIntegral>::is_signed ? 1 : 2 ) { v.value= int64_t(value); }
84
85
86 /// Alternative constructor that omits parameter \p{overrideWidth} and set it to \c 0.
87 /// @tparam TIntegral The type of argument \p{value}. Deduced by the compiler.
88 /// Only integral values are accepted.
89 /// @param value The value to write.
90 /// @param numberFormat The number format to use.
91 /// Defaults to \c nullptr which chooses the static singleton found in
92 /// #"TNumberFormat::Computational;NumberFormat::Computational".
93 template<typename TIntegral>
94 requires std::integral<TIntegral>
95 TDec( TIntegral value,
96 TNumberFormat<TChar>* numberFormat = nullptr )
97 : nf (numberFormat)
98 , width (0)
99 , valueType( std::numeric_limits<TIntegral>::is_signed ? 1 : 2 ) { v.value= int64_t(value); }
100
101
102 /// Constructor. Stores parameters.
103 /// @tparam TFloat The type of argument \p{value}. Deduced by the compiler.
104 /// Only floating-point values are accepted.
105 /// @param value The value to write.
106 /// @param overrideWidth Defaults to \c 0 which denotes to choose the value of field
107 /// #"TNumberFormat::DecMinimumFieldWidth;NumberFormat::DecMinimumFieldWidth".
108 /// @param numberFormat The number format to use.
109 /// Defaults to \c nullptr which chooses the static singleton found in
110 /// #"TNumberFormat::Computational;NumberFormat::Computational".
111 template<typename TFloat>
112 requires std::floating_point<TFloat>
113 TDec( TFloat value,
114 int overrideWidth= 0,
115 TNumberFormat<TChar>* numberFormat = nullptr )
116 : nf (numberFormat)
117 , width (overrideWidth)
118 , valueType( 3 ) { v.fpValue= double(value); }
119
120 /// Alternative constructor that omits parameter \p{overrideWidth} and set it to \c 0.
121 /// @tparam TFloat The type of argument \p{value}. Deduced by the compiler.
122 /// Only floating-point values are accepted.
123 /// @param value The value to write.
124 /// @param numberFormat The number format to use.
125 /// Defaults to \c nullptr which chooses the static singleton found in
126 /// #"TNumberFormat::Computational;NumberFormat::Computational".
127 template<typename TFloat>
128 requires std::floating_point<TFloat>
129 TDec( TFloat value,
130 TNumberFormat<TChar>* numberFormat = nullptr )
131 : nf (numberFormat)
132 , width ( 0 )
133 , valueType( 3 ) { v.fpValue= double(value); }
134
135}; // class format
136
137
138/// Implements a temporary object which is #"alib_strings_assembly_ttostring;appended"
139/// to instances of type #"^AString".
140///
141/// Appends \e tab characters (as provided) to reach a certain length (aka tabulator position)
142/// of the \p{target}. The tab position is referenced to an optionally given \p{reference} value
143/// which might be the start of the string or the position of the last newline. If this
144/// parameter is negative, the last newline characters are searched from the end of the
145/// string backwards.<br>
146/// Referring to that as position 0, the tab position is then located at the next multiple
147/// of parameter \p{tabSize}, after having added \p{minPad} tab characters.
148/// @tparam TChar The #"alib_characters_chars;character type" of the #"%AString" that
149/// instances can be "applied" to.
150template<typename TChar>
151struct TTab {
152 /// The tab positions are multiples of this value.
154
155 /// The reference length of the AString which is taken as relative tab position
156 /// (instead of the beginning of the string). If -1, the target AString is
157 /// searched backwards for the last newline and this position is used as the
158 /// reference.
160
161 /// The minimum pad characters to add. Defaults to 1.
163
164 /// The character to insert to reach the tab position. Normally this is the space
165 /// character ' '.
166 TChar tabChar;
167
168 /// Constructor. Copies the parameters.
169 ///
170 /// @param size The tab positions are multiples of this parameter.
171 /// @param referenceIdx The reference index marking the start of the actual line.
172 /// If -1, the last new-line character is searched from the end of
173 /// the string backwards, and used. Defaults to 0.
174 /// @param minPadChars The minimum pad characters to add. Defaults to 1.
175 /// @param fillChar The character to insert to reach the tab position.
176 /// Defaults to ' ' (space).
177 TTab( integer size, integer referenceIdx = 0, integer minPadChars= 1, TChar fillChar= ' ' )
178 : tabSize(size), reference(referenceIdx), minPad(minPadChars), tabChar(fillChar) {}
179};
180
181#if !ALIB_BOXING
182// This version of the class is only used if module Boxing is not available.
183template<typename TChar>
184struct TField
185{
186 public:
187 const TString<TChar>& theContent;
188 integer fieldWidth; ///< The width of the field.
189 lang::Alignment alignment; ///< The alignment of the contents within the field.
190 TChar padChar; ///< The characters used for padding the contents within the field.
191
192 TField( const TString<TChar>& content,
193 integer pWidth,
195 TChar fillChar = ' ' )
196 : theContent(content.IsNotNull() ? content : EMPTY_STRING )
197 , fieldWidth(pWidth)
198 , alignment (pAlignment)
199 , padChar (fillChar) {}
200};
201#endif// !ALIB_BOXING
202
203/// Implements a temporary object which is #"alib_strings_assembly_ttostring;appended"
204/// to instances of type #"^AString".
205///
206/// Escapes non-printable characters in the given region, or reversely converts such escaped
207/// characters to their ASCII values.
208///
209/// The characters converted are
210/// <c>'\\\\'</c>, <c>'\\r'</c>, <c>'\\n'</c>, <c>'\\t'</c>, <c>'\\a'</c>,
211/// <c>'\\b'</c>, <c>'\\v'</c>, <c>'\\f'</c>, <c>'\\e'</c> and <c>'"'</c>.
212///
213/// If the new region length is needed to be known, it can be calculated as the sum of
214/// the old region length and the difference of the string's length before and after the
215/// operation.
216/// @tparam TChar The #"alib_characters_chars;character type" of the #"%AString" that
217/// instances can be "applied" to.
218template<typename TChar>
219struct TEscape {
220 public:
221 /// The direction of conversion: #"%Switch::On" escapes ascii characters, while
222 /// #"%Switch::Off" converts escaped strings to ascii codes.
224
225 /// The start of the region to convert.
227
228 /// The length of the region to convert.
230
231
232 /// Constructor. Copies the parameters.
233 ///
234 /// @param escape #"%Switch::On" escapes ascii characters (the default),
235 /// #"%Switch::Off" converts escaped strings to ascii codes.
236 /// @param regionStart The start of the region to convert.
237 /// @param regionLength The length of the region to convert.
238 TEscape( lang::Switch escape= lang::Switch::On, integer regionStart = 0, integer regionLength =MAX_LEN )
239 : pSwitch(escape), startIdx(regionStart), length(regionLength) {}
240};
241
242
243/// Implements a temporary object which can be #"alib_strings_assembly_ttostring;appended"
244/// to instances of type #"^AString".
245///
246/// Appends an integral value in binary format.
247///
248/// \see
249/// Class #"str TNumberFormat" for more information on formatting options for binary
250/// number output.
251/// @tparam TChar The #"alib_characters_chars;character type" of the #"%AString" that
252/// instances can be "applied" to.
253template<typename TChar>
254struct TBin {
255 public:
256 uint64_t theValue; ///< The value to write.
257 int theWidth; ///< The minimum width of the number to write.
258 ///< Defaults to \c 0
259 ///< which denotes to choose the value of field
260 ///< #"TNumberFormat::BinFieldWidth;NumberFormat::BinFieldWidth".
261 TNumberFormat<TChar>* nf; ///< The number format to use. Defaults to \c nullptr which chooses
262 ///< #"TNumberFormat::Computational;NumberFormat::Computational".
263
264 /// Constructor, taking the value and formatting parameters.
265 ///
266 /// @tparam TIntegral Value type which has to be statically castable to \c std::uint64_t.
267 /// @param value The value to write.
268 /// @param overrideWidth Defaults to \c 0 which
269 /// denotes to choose the value of field
270 /// #"TNumberFormat::BinFieldWidth;NumberFormat::BinFieldWidth".
271 /// @param numberFormat The number format to use. Defaults to \c nullptr which chooses
272 /// the static singleton found in
273 /// #"TNumberFormat::Computational;NumberFormat::Computational".
274 template<typename TIntegral>
275 TBin( TIntegral value,
276 int overrideWidth= 0,
277 TNumberFormat<TChar>* numberFormat = nullptr )
278 : theValue (uint64_t(value))
279 , theWidth (overrideWidth)
280 , nf (numberFormat) {}
281
282 /// Constructor, taking the value and a just an object of type #"%^NumberFormat".
283 ///
284 /// @tparam TIntegral Value type which has to be statically castable to \c std::uint64_t.
285 /// @param value The value to write.
286 /// @param numberFormat The number format to use. Defaults to \c nullptr which chooses
287 /// the static singleton found in
288 /// #"str TNumberFormat::Computational".
289 template<typename TIntegral>
290 TBin( TIntegral value, TNumberFormat<TChar>* numberFormat )
291 : theValue (uint64_t(value))
292 , theWidth (0)
293 , nf (numberFormat) {}
294
295};
296
297/// Implements a temporary object which is #"alib_strings_assembly_ttostring;appended"
298/// to instances of type #"^AString".
299///
300/// Appends an integral value in hexadecimal format.
301///
302/// \see
303/// Class #"str TNumberFormat" for more information on formatting options for
304/// hexadecimal number output.
305/// @tparam TChar The #"alib_characters_chars;character type" of the #"%AString" that
306/// instances can be "applied" to.
307template<typename TChar>
308struct THex {
309 uint64_t theValue; ///< The value to write.
310 int theWidth; ///< The minimum width of the number to write.
311 ///< Defaults to \c 0
312 ///< which denotes choosing the value of field
313 ///< #"str TNumberFormat::HexFieldWidth".
314 TNumberFormat<TChar>* nf; ///< The number format to use. Defaults to \c nullptr which chooses
315 ///< #"str TNumberFormat::Computational".
316
317 /// Constructor, taking the value and formatting parameters.
318 ///
319 /// @tparam TIntegral Value type which has to be statically castable to \c std::uint64_t.
320 /// @param value The value to write.
321 /// @param overrideWidth Defaults to \c 0 which
322 /// denotes to choose the value of field
323 /// #"TNumberFormat::HexFieldWidth;NumberFormat::HexFieldWidth".
324 /// @param numberFormat The number format to use. Defaults to \c nullptr which chooses
325 /// the static singleton found in
326 /// #"TNumberFormat::Computational;NumberFormat::Computational".
327 template<typename TIntegral>
328 THex( TIntegral value, int overrideWidth= 0, TNumberFormat<TChar>* numberFormat = nullptr )
329 : theValue (uint64_t(value))
330 , theWidth (overrideWidth)
331 , nf (numberFormat) {}
332
333 /// Constructor, taking the value and a just an object of type #"%^NumberFormat".
334 ///
335 /// @param value The value to write.
336 /// @param numberFormat The number format to use. Defaults to \c nullptr which chooses
337 /// the static singleton found in
338 /// #"TNumberFormat::Computational;NumberFormat::Computational".
339 template<typename TIntegral>
340 THex( TIntegral value, TNumberFormat<TChar>* numberFormat )
341 : theValue (uint64_t(value))
342 , theWidth (0)
343 , nf (numberFormat) {}
344};
345
346/// Implements a temporary object which is #"alib_strings_assembly_ttostring;appended"
347/// to instances of type #"^AString".
348///
349/// Appends an integral value in octal format.
350///
351/// \see
352/// Class #"str TNumberFormat" for more information on formatting options for octal
353/// number output.
354/// @tparam TChar The #"alib_characters_chars;character type" of the #"%AString" that
355/// instances can be "applied" to.
356template<typename TChar>
357struct TOct {
358 uint64_t theValue; ///< The value to write.
359 int theWidth; ///< The minimum width of the number to write.
360 ///< Defaults to \c 0
361 ///< which denotes to choose the value of field
362 ///< #"TNumberFormat::OctFieldWidth;NumberFormat::OctFieldWidth".
363 TNumberFormat<TChar>* nf; ///< The number format to use. Defaults to \c nullptr which chooses
364 ///< #"TNumberFormat::Computational;NumberFormat::Computational".
365
366 /// Constructor, taking the value and formatting parameters.
367 ///
368 /// @tparam TIntegral Value type which has to be statically castable to \c std::uint64_t.
369 /// @param value The value to write.
370 /// @param overrideWidth Defaults to \c 0 which
371 /// denotes to choose the value of field
372 /// #"TNumberFormat::OctFieldWidth;NumberFormat::OctFieldWidth".
373 /// @param numberFormat The number format to use. Defaults to \c nullptr which chooses
374 /// the static singleton found in
375 /// #"TNumberFormat::Computational;NumberFormat::Computational".
376 template<typename TIntegral>
377 TOct( TIntegral value, int overrideWidth= 0, TNumberFormat<TChar>* numberFormat = nullptr )
378 : theValue (uint64_t(value))
379 , theWidth (overrideWidth)
380 , nf (numberFormat) {}
381
382 /// Constructor, taking the value and a just an object of type #"%^NumberFormat".
383 ///
384 /// @tparam TIntegral Value type which has to be statically castable to \c std::uint64_t.
385 /// @param value The value to write.
386 /// @param numberFormat The number format to use. Defaults to \c nullptr which chooses
387 /// the static singleton found in
388 /// #"TNumberFormat::Computational;NumberFormat::Computational".
389 template<typename TIntegral>
390 TOct( TIntegral value, TNumberFormat<TChar>* numberFormat )
391 : theValue (uint64_t(value))
392 , theWidth (0)
393 , nf (numberFormat) {}
394};
395
396/// Implements a temporary object which is #"alib_strings_assembly_ttostring;appended"
397/// to instances of type #"^AString".<br>
398/// Appends a given number of characters.
399/// @tparam TChar The #"alib_characters_chars;character type" of the #"%AString" that
400/// instances can be "applied" to.
401template<typename TChar>
402struct TFill {
403 TChar fillChar; ///< The character to write.
404 int count; ///< The number of characters to write.
405
406 /// Constructor.
407 /// @param pFillChar The character to write.
408 /// @param pCount The number of characters to write.
409 TFill(TChar pFillChar, int pCount )
410 : fillChar(pFillChar)
411 , count (pCount) {}
412};
413
414//##################################################################################################
415// Corresponding specializations of struct AppendableTraits
416//##################################################################################################
417
418// Faking all template specializations of namespace strings for doxygen into namespace
419// strings::APPENDABLES to keep the documentation of namespace string clean!
420#if DOXYGEN
421 namespace APPENDABLES {
422#endif
423
424/// Specialization of functor #"AppendableTraits" for type \c Format.
425template<typename TChar, typename TAllocator>
426struct AppendableTraits<TDec<TChar> ,TChar,TAllocator>
427{
428 /// Appends a string representation of the value encapsulated in the given \p{src} value.
429 /// @param target The #"%AString" that #"%Append(const TAppendable&)" was invoked on.
430 /// @param src The format object.
432};
433
434/// Specialization of functor #"AppendableTraits" for type \c TTab.
435template<typename TChar, typename TAllocator>
436struct AppendableTraits<TTab<TChar> ,TChar,TAllocator>
437{
438 /// Appends tabulator characters to the given string.
439 ///
440 /// @param target The #"%AString" that #"%Append(const TAppendable&)" was invoked on.
441 /// @param tab The object to append.
443};
444
445#if !ALIB_BOXING
446template<typename TChar, typename TAllocator>
447struct AppendableTraits<TField<TChar> ,TChar,TAllocator>
448{
449 void operator()( TAString<TChar,TAllocator>& target, const TField<TChar>& field);
450};
451#endif
452
453/// Specialization of functor #"AppendableTraits" for type \c Escape.
454template<typename TChar, typename TAllocator>
455struct AppendableTraits<TEscape<TChar> ,TChar,TAllocator>
456{
457 /// Escapes or un-escapes the characters in the given string.
458 ///
459 /// @param target The #"%AString" that #"%Append(const TAppendable&)" was invoked on.
460 /// @param esc The object to append.
462};
463
464/// Specialization of functor #"AppendableTraits" for type \c Bin.
465template<typename TChar, typename TAllocator>
466struct AppendableTraits<TBin<TChar> ,TChar,TAllocator>
467{
468 /// Appends a string representation of the given \p{src}.
469 /// @param target The #"%AString" that #"%Append(const TAppendable&)" was invoked on.
470 /// @param src The format object.
472};
473
474/// Specialization of functor #"AppendableTraits" for type \c Hex.
475template<typename TChar, typename TAllocator>
476struct AppendableTraits<THex<TChar>,TChar,TAllocator>
477{
478 /// Appends a string representation of the given \p{src}.
479 /// @param target The #"%AString" that #"%Append(const TAppendable&)" was invoked on.
480 /// @param src The format object.
482};
483
484/// Specialization of functor #"AppendableTraits" for type \c Oct.
485template<typename TChar, typename TAllocator>
486struct AppendableTraits<TOct<TChar> ,TChar,TAllocator>
487{
488 /// Appends a string representation of the given \p{src}.
489 /// @param target The #"%AString" that #"%Append(const TAppendable&)" was invoked on.
490 /// @param src The format object.
492};
493
494/// Specialization of functor #"AppendableTraits" for type \c Fill.
495template<typename TChar, typename TAllocator>
496struct AppendableTraits<TFill<TChar> ,TChar,TAllocator>
497{
498 /// Appends a string representation of the given \p{src}.
499 /// @param target The #"%AString" that #"%Append(const TAppendable&)" was invoked on.
500 /// @param src The format object.
502};
503// Faking all template specializations of namespace strings for doxygen into namespace
504// strings::APPENDABLES to keep the documentation of namespace string clean!
505#if DOXYGEN
506}
507#endif
508}
509
510/// Type alias in namespace #"%alib".
512
513/// Type alias in namespace #"%alib".
515
516/// Type alias in namespace #"%alib".
518
519#if !ALIB_BOXING
520/// Type alias in namespace #"%alib".
522
523/// Type alias in namespace #"%alib".
525
526/// Type alias in namespace #"%alib".
528#endif
529
530/// Type alias in namespace #"%alib".
532
533/// Type alias in namespace #"%alib".
535
536/// Type alias in namespace #"%alib".
538
539/// Type alias in namespace #"%alib".
541
542/// Type alias in namespace #"%alib".
544
545/// Type alias in namespace #"%alib".
547
548/// Type alias in namespace #"%alib".
550
551/// Type alias in namespace #"%alib".
553
554/// Type alias in namespace #"%alib".
556
557/// Type alias in namespace #"%alib".
559
560/// Type alias in namespace #"%alib".
562
563/// Type alias in namespace #"%alib".
565
566/// Type alias in namespace #"%alib".
568
569/// Type alias in namespace #"%alib".
571
572/// Type alias in namespace #"%alib".
574
575/// Type alias in namespace #"%alib".
577
578/// Type alias in namespace #"%alib".
580
581/// Type alias in namespace #"%alib".
583
584} // namespace [alib::strings]
#define ALIB_EXPORT
union alib::strings::TDec::@267101115115346157177065261317231127012275262257 v
The data.
TDec(TFloat value, TNumberFormat< TChar > *numberFormat=nullptr)
Definition format.hpp:129
TDec(TIntegral value, int overrideWidth=0, TNumberFormat< TChar > *numberFormat=nullptr)
Definition format.hpp:78
TNumberFormat< character > * nf
Definition format.hpp:58
TDec(TFloat value, int overrideWidth=0, TNumberFormat< TChar > *numberFormat=nullptr)
Definition format.hpp:113
TDec(TIntegral value, TNumberFormat< TChar > *numberFormat=nullptr)
Definition format.hpp:95
Alignment
Denotes Alignments.
@ Right
Chooses right alignment.
Switch
Denotes if sth. is switched on or off.
@ On
Switch it on, switched on, etc.
constexpr integer MAX_LEN
The maximum length of an ALib string.
Definition string.hpp:51
Definition alox.cpp:14
strings::TDec< nchar > NDec
Type alias in namespace #"%alib".
Definition format.hpp:543
strings::THex< wchar > WHex
Type alias in namespace #"%alib".
Definition format.hpp:555
strings::TFill< wchar > WFill
Type alias in namespace #"%alib".
Definition format.hpp:582
strings::TOct< wchar > WOct
Type alias in namespace #"%alib".
Definition format.hpp:564
strings::TField< nchar > NField
Type alias in namespace #"%alib".
strings::TFill< nchar > NFill
Type alias in namespace #"%alib".
Definition format.hpp:579
strings::TTab< nchar > NTab
Type alias in namespace #"%alib".
Definition format.hpp:514
strings::TEscape< nchar > NEscape
Type alias in namespace #"%alib".
Definition format.hpp:534
strings::TFill< character > Fill
Type alias in namespace #"%alib".
Definition format.hpp:576
strings::TEscape< character > Escape
Type alias in namespace #"%alib".
Definition format.hpp:531
strings::TBin< wchar > WBin
Type alias in namespace #"%alib".
Definition format.hpp:573
constexpr const String EMPTY_STRING
An empty string of the default character type.
Definition string.hpp:2227
strings::TField< wchar > WField
Type alias in namespace #"%alib".
lang::integer integer
Type alias in namespace #"%alib".
Definition integers.hpp:149
strings::TOct< nchar > NOct
Type alias in namespace #"%alib".
Definition format.hpp:561
strings::TField< character > Field
Type alias in namespace #"%alib".
strings::TBin< nchar > NBin
Type alias in namespace #"%alib".
Definition format.hpp:570
strings::TDec< character > Dec
Type alias in namespace #"%alib".
Definition format.hpp:540
strings::TDec< wchar > WDec
Type alias in namespace #"%alib".
Definition format.hpp:546
strings::TTab< wchar > WTab
Type alias in namespace #"%alib".
Definition format.hpp:517
strings::TBin< character > Bin
Type alias in namespace #"%alib".
Definition format.hpp:567
strings::TOct< character > Oct
Type alias in namespace #"%alib".
Definition format.hpp:558
strings::TEscape< wchar > WEscape
Type alias in namespace #"%alib".
Definition format.hpp:537
strings::THex< character > Hex
Type alias in namespace #"%alib".
Definition format.hpp:549
strings::THex< nchar > NHex
Type alias in namespace #"%alib".
Definition format.hpp:552
strings::TTab< character > Tab
Type alias in namespace #"%alib".
Definition format.hpp:511
void operator()(TAString< TChar, TAllocator > &target, const TBin< TChar > &src)
void operator()(TAString< TChar, TAllocator > &target, const TDec< TChar > &src)
void operator()(TAString< TChar, TAllocator > &target, const TEscape< TChar > &esc)
void operator()(TAString< TChar, TAllocator > &target, const TFill< TChar > &src)
void operator()(TAString< TChar, TAllocator > &target, const THex< TChar > &src)
void operator()(TAString< TChar, TAllocator > &target, const TOct< TChar > &src)
void operator()(TAString< TChar, TAllocator > &target, const TTab< TChar > &tab)
TBin(TIntegral value, int overrideWidth=0, TNumberFormat< TChar > *numberFormat=nullptr)
Definition format.hpp:275
TNumberFormat< character > * nf
Definition format.hpp:261
TBin(TIntegral value, TNumberFormat< TChar > *numberFormat)
Definition format.hpp:290
TEscape(lang::Switch escape=lang::Switch::On, integer regionStart=0, integer regionLength=MAX_LEN)
Definition format.hpp:238
integer fieldWidth
The width of the field.
TChar padChar
The characters used for padding the contents within the field.
lang::Alignment alignment
The alignment of the contents within the field.
TField(Box content, integer pWidth, lang::Alignment pAlignment=lang::Alignment::Right, TChar fillChar=' ')
TFill(TChar pFillChar, int pCount)
Definition format.hpp:409
THex(TIntegral value, int overrideWidth=0, TNumberFormat< TChar > *numberFormat=nullptr)
Definition format.hpp:328
THex(TIntegral value, TNumberFormat< TChar > *numberFormat)
Definition format.hpp:340
TNumberFormat< character > * nf
Definition format.hpp:314
TOct(TIntegral value, TNumberFormat< TChar > *numberFormat)
Definition format.hpp:390
TNumberFormat< character > * nf
Definition format.hpp:363
TOct(TIntegral value, int overrideWidth=0, TNumberFormat< TChar > *numberFormat=nullptr)
Definition format.hpp:377
TTab(integer size, integer referenceIdx=0, integer minPadChars=1, TChar fillChar=' ')
Definition format.hpp:177