BloombergLP::bslfmt

Bloomberg formatting library namespace.

Types

NameDescription
EnableStreamedFormatter A nested-trait-declaration compatible boolean trait indicating whether a type that is passed to bsl::format will be formatted using its ostream insertion operator, operator<<.
FormatSpecificationParser A general mechanism used in format specification parsers. It supports parsing syntaxes of the form fill-and-align?sign # 0 width?precision?L and any syntax that contains a subset of the sections therein.
FormatSpecificationParserEnums Namespace struct holding enums used for parsing.
Format_ArgUtil This class provides utility functions to enable manipulation of types declared by this component. It is solely for private use by other components of the bslfmt package and should not be used directly.
Format_ArgsStore This component-private type holds an array of basic_format_arg objects and is intended to be implicitly convertible to basic_format_args. Note that this type has reference semantics and users must ensure that this type does not outlive the arguments used in its construction.
Format_ArgsUtil This class provides utility functions to enable manipulation of types declared by this component. It is solely for private use by other components of the bslfmt package and should not be used directly.
Format_ContextFactory This class provides utility functions to enable manipulation of types declared by this component. It is solely for private use by other components of the bslfmt package and should not be used directly.
Format_ContextOutputIteratorBase This component-private type is an abstract base required to type-erase output iterators as required by the format_context and wformat_context typedefs.
Format_ContextOutputIteratorImpl This type holds a reference to an iterator, and is used to type-erase output iterators as required by the format_context and wformat_context typedefs. It is solely for private use by other components of the bslfmt package and should not be used directly.
Format_ContextOutputIteratorRef This class provides a type-erased interface to an output iterator that it holds indirectly via a reference to a Format_ContextOutputIteratorImpl type. It is solely for private use by other components of the bslfmt package and should not be used directly.
Format_String_TestUpdater This is a component-private type which enables test drivers to work around the compile-time restrictions in basic_format_string construction.
FormatterBase_IsStdBasicString Simple trait type that tells is t_TYPE is an instance of std::basic_string.
FormatterBase_IsStdBasicStringView Simple trait type that tells is t_TYPE is an instance of std::basic_string_view.
FormatterBase_IsStdChronoCpp20FormattableType Simple trait type that tells is t_TYPE is an instance of any of the C++20 standard formattable std::chrono types.
FormatterBase_IsStdChronoDuration Simple trait type that tells is t_TYPE is an instance of std::chrono::duration.
FormatterBase_IsStdChronoFileTime Simple trait type that tells is t_TYPE is an instance of std::chrono::file_time.
FormatterBase_IsStdChronoGpsTime Simple trait type that tells is t_TYPE is an instance of std::chrono::gps_time.
FormatterBase_IsStdChronoHhMmSs Simple trait type that tells is t_TYPE is an instance of std::chrono::hh_mm_ss.
FormatterBase_IsStdChronoLocalTime Simple trait type that tells is t_TYPE is an instance of std::chrono::local_time.
FormatterBase_IsStdChronoPointInTimeType Simple trait type that tells is t_TYPE is an instance of any of the std::chrono types that deal with points in time.
FormatterBase_IsStdChronoSysTime Simple trait type that tells is t_TYPE is an instance of std::chrono::sys_time.
FormatterBase_IsStdChronoTaiTime Simple trait type that tells is t_TYPE is an instance of std::chrono::tai_time.
FormatterBase_IsStdChronoTimeType Simple trait type that tells is t_TYPE is an instance of any of std::chrono::*_time.
FormatterBase_IsStdChronoUtcTime Simple trait type that tells is t_TYPE is an instance of std::chrono::utc_time.
FormatterBase_IsStdChronoZonedTime Simple trait type that tells is t_TYPE is an instance of std::chrono::zoned_time.
FormatterCharUtil This struct provides a namespace for a utility functions that convert characters (e.g. char to wchar_t or lowercase characters to uppercase). Notice that this structure has specializations only for char and wchar_t types.
FormatterCharacter_CharacterOutput This struct provides a function that outputs the specified value to the specified out.
FormatterCharacter_MakeUnsigned This struct template implements the make_unsigned meta-function defined in the C++11 standard [meta.trans.sign], providing an alias, type, that returns the result. The type is the unsigned analogue of the (template parameter) t_TYPE.
FormatterFloating_Base This class template provides the implementation for all possible floating point formatting styles and the parsing of the format specification. The specified t_VALUE template type argument determines the type of floating point value use, while the specified t_CHAR determines the output's character type. The behavior is undefined unless t_VALUE is one of float or double, and t_CHAR is on of char or wchar_t.
FormatterIntegralBase This struct is a base class for bsl::formatter specializations for integer types as well as for other types that can be represented as integer (i.e. bool, character and pointer types). This is a private class and should not be used directly. The formatting of variables of a certain type is performed using the corresponding classes inherited from this one. Accordingly, the auxiliary functions used are declared protected.
FormatterIntegral_Category This struct provides a function that returns a category of the formatter in accordance with the (template parameter) t_VALUE_TYPE.
FormatterPointer_Nullptr This struct is a specialization of the bsl::formatter template for the bsl::nullptr_t.
FormatterSpecificationNumericValue Type holding a category plus an optional integral value. This is a value semantic type primarily used to represent width and precision of a format specification.
FormatterSpecificationNumericValue_ArgVisitor Component-private type to enable extraction of values held by format contexts during the postprocessing stage of determining the format specification (typically performed by the FormatSpecificationParser). This type exists so that FormatSpecificationParser can update FormatterSpecificationNumericValue to the value contained by a Standard basic_format_arg using the Standard visit_format_arg function.
FormatterString_GraphemeCluster [PRIVATE]This private implementation class characterizes a grapheme cluster represented by a set of integral values. This class is private to this component and should not be used by clients.
FormatterTestUtil This struct provides a namespace for test functions that verify the correctness of formatting performed by bslfmt tools. Due to the limitations of template argument deduction, it is necessary to explicitly specialize the FormatterTestUtil template for char and wchar_t.
FormatterTestUtil_Oracle This template struct provides a namespace for a utility function that creates a string containing the result of formatting done by standard implementations. This struct is meant for test purposes only.
FormatterUnicodeData [PRIVATE]This private implementation struct contains data for correct processing of Unicode characters. These data are private to this package and should not be used by clients.
MockFormatContext This unconstrained (value-semantic) class provides an access to the current state of the format operation and is used for testing bsl::formatter specializations.
MockFormatContext_Iterator This class template provides an output iterator to the MockFormatContext output buffer allowing appending formatted data.
MockParseContext This class template provides an access to the format specification current parsing state.
PadUtil This struct serves as a namespace for static functions related to padding output by bslfmt.
StandardFormatSpecification A general mechanism to parse and validate a Standard format specification string for a given argument type.
Streamed This class provides a wrapper to enable a streamable type to be used with bsl::format (and std::format) when no formatter specialization is provided (the type is not formattable). Note that it is possible to use this wrapper with types that have a formatter, if the compiler supports it we give a compilation warning directing the user to use the existing formatter instead of wrapping to use the streaming operator.
StreamedFormatter This class provides the implementations of parse and format for formatters that format a type using its streaming operator.
Streamed_NoWarningConstructorTag A component private tag type used to internally construct a Streamed object without a warning (about an already existing formatter).
TestSpecificationGenerator This class is a generator that provides a set of formatting specifications obtained by exhaustive search of all combinations of standard options. Its use allows easy and thorough testing of formatters for standard types. The generator is a state machine, each state of which corresponds to a separate specification.
TestSpecificationGenerator_BoolOption This class is an implementation of the TestSpecificationGenerator_Option for options that have only two states: they are either present or not.
TestSpecificationGenerator_Option This class is a base class for TestSpecificationGenerator option nodes, which, when compiled into a list, represent the state of the generator. The payload and the process of changing this state are programmed into specific implementations of this interface. This class contains the basic functions of adding a new link to the options chain and finding the last link in the chain.
TestSpecificationGenerator_TypedOption This class is an implementation of the TestSpecificationGenerator_Option for options that iterate through the states specified by the set of t_TYPE (template parameter) values. The state is determined by the interaction of two class fields: a flag indicating the presence of the option and a specific value for the option. If the flag indicates that the option is not present, the value of the second field is ignored.
UnicodeCodePoint This simply constrained (value-semantic) attribute class characterizes a Unicode code point represented by a set of integral values. This class is private to this package and should not be used by clients.
basic_format_arg Type-erased format argument holding a value for formatting.
basic_format_args A class intended to provide access to formatting arguments. This should not be constructed directly but indirectly using one of the make_format_args or the make_wformat_args functions. Note that this type has reference semantics and users must ensure that this type does not outlive the arguments used in its construction.
basic_format_context A format context for use by formatter::format() partial specialization. It provides access to the output iterator for writing the formatted value and access to all formatting arguments.
basic_format_parse_context A format context for use by formatter::parse() partial specialization. It provides access to iterators for the start and end of the remaining (unparsed) format string, as well as argument counters.
basic_format_string Type that wraps a basic_string_view for use by formatting function. The constructor performs additional compile-time checks of the format string provided (not yet implemented).

Type Aliases

NameDescription
format_args Alias for basic_format_args specialized on a char format context.
format_context Alias for basic_format_context specialized on char.
format_parse_context Alias for basic_format_parse_context specialized on char.
format_string Alias for a checked char format string.
wformat_args Alias for basic_format_args specialized on a wchar_t format context.
wformat_context Alias for basic_format_context specialized on wchar_t.
wformat_parse_context Alias for basic_format_parse_context specialized on wchar_t.
wformat_string Alias for a checked wchar_t format string.

Functions

NameDescription
format format overloads
format_to format_to overloads
format_to_n Format args per fmtStr into out, writing at most maxNumChars characters.
formatted_size Calculate the length of the resulting string if the specified args were to be formatted according to the specification given by the specified fmtStr, and return the result.
make_format_args From the specified fmt_args return a type convertible to format_arg_store that is suitable for use by the char-based bslfmt::format functions.
make_wformat_args From the specified fmt_args return a type convertible to format_arg_store that is suitable for use by the wchar_t-based bslfmt::format functions.
print print overloads
println println overloads
streamed streamed overloads
swap Exchange the values of the specified lhs and rhs.
vformat vformat overloads
vformat_to vformat_to overloads
visit_format_arg Invoke the specified visitor functor on the value contained by the specified arg, providing that functor non-modifiable access to that value. visitor must be a variant-style functor that is able to visit all supported types listed in the {DESCRIPTION}.
vprint_nonunicode vprint_nonunicode overloads
vprint_nonunicode_buffered Format the specified args using bsl::vformat_to according to the specification given by the specified fmt to a temporary buffer, and write the resulting buffer to the specified stream. In the event of formatting error throw the exception format_error, in the event of I/O error throw the exception system_error, on allocation failure throw bad_alloc. The behavior is undefined unless stream is a valid pointer to an output C stream.
vprint_unicode vprint_unicode overloads
vprint_unicode_buffered Format the specified args using bsl::vformat_to according to the specification given by the specified fmt to a temporary buffer, and write the resulting buffer to the specified stream. In the event of formatting error throw the exception format_error, in the event of I/O error throw the exception system_error, on allocation failure throw bad_alloc. The behavior is undefined unless stream is a valid pointer to an output C stream.

Using Declarations

NameDescription
format_error Alias for std::format_error in the bsl namespace.
format_to_n_result Alias for std::format_to_n_result in the bslfmt namespace.