|
BDE 4.39.x Production Release
|
Character conversion utilities for bsl::format.
Character conversion utilities for bsl::format.
This component provides a FormatterCharUtil struct template that is a namespace for utility functions that convert characters (e.g. from char to wchar_t or lowercase characters to uppercase).
This section illustrates intended use of this component.
Suppose we need to output a hexadecimal number to some object (e.g. some character buffer) represented by the output iterator. Additionally, we are required to have the number displayed in uppercase.
First, we convert the number to uppercase in place and verify the result:
Next, we output this uppercase number to the destination, using outputFromChar function. OutputIterator in this example is just a primitive class that minimally satisfies the requirements of the output iterator.
Finally, we demonstrate the main purpose of these functions - to unify the output of values to character strings and wide character strings. All we need to do is just change the template parameter: