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