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