[#BloombergLP-bslfmt] = xref:BloombergLP.adoc[BloombergLP]::bslfmt :relfileprefix: ../ :mrdocs: Bloomberg formatting library namespace. == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslfmt/EnableStreamedFormatter.adoc[`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<<`. | xref:BloombergLP/bslfmt/FormatSpecificationParser.adoc[`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. | xref:BloombergLP/bslfmt/FormatSpecificationParserEnums.adoc[`FormatSpecificationParserEnums`] | Namespace struct holding enums used for parsing. | xref:BloombergLP/bslfmt/Format_ArgUtil.adoc[`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. | xref:BloombergLP/bslfmt/Format_ArgsStore.adoc[`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. | xref:BloombergLP/bslfmt/Format_ArgsUtil.adoc[`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. | xref:BloombergLP/bslfmt/Format_ContextFactory.adoc[`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. | xref:BloombergLP/bslfmt/Format_ContextOutputIteratorBase.adoc[`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. | xref:BloombergLP/bslfmt/Format_ContextOutputIteratorImpl.adoc[`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. | xref:BloombergLP/bslfmt/Format_ContextOutputIteratorRef.adoc[`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. | xref:BloombergLP/bslfmt/Format_String_TestUpdater.adoc[`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. | xref:BloombergLP/bslfmt/FormatterBase_IsStdBasicString-07.adoc[`FormatterBase_IsStdBasicString`] | Simple trait type that tells is `t_TYPE` is an instance of `std::basic_string`. | xref:BloombergLP/bslfmt/FormatterBase_IsStdBasicStringView-09.adoc[`FormatterBase_IsStdBasicStringView`] | Simple trait type that tells is `t_TYPE` is an instance of `std::basic_string_view`. | xref:BloombergLP/bslfmt/FormatterBase_IsStdChronoCpp20FormattableType.adoc[`FormatterBase_IsStdChronoCpp20FormattableType`] | Simple trait type that tells is `t_TYPE` is an instance of any of the C++20 standard formattable `std::chrono` types. | xref:BloombergLP/bslfmt/FormatterBase_IsStdChronoDuration-07.adoc[`FormatterBase_IsStdChronoDuration`] | Simple trait type that tells is `t_TYPE` is an instance of `std::chrono::duration`. | xref:BloombergLP/bslfmt/FormatterBase_IsStdChronoFileTime-08.adoc[`FormatterBase_IsStdChronoFileTime`] | Simple trait type that tells is `t_TYPE` is an instance of `std::chrono::file_time`. | xref:BloombergLP/bslfmt/FormatterBase_IsStdChronoGpsTime-0c.adoc[`FormatterBase_IsStdChronoGpsTime`] | Simple trait type that tells is `t_TYPE` is an instance of `std::chrono::gps_time`. | xref:BloombergLP/bslfmt/FormatterBase_IsStdChronoHhMmSs-01.adoc[`FormatterBase_IsStdChronoHhMmSs`] | Simple trait type that tells is `t_TYPE` is an instance of `std::chrono::hh_mm_ss`. | xref:BloombergLP/bslfmt/FormatterBase_IsStdChronoLocalTime-07.adoc[`FormatterBase_IsStdChronoLocalTime`] | Simple trait type that tells is `t_TYPE` is an instance of `std::chrono::local_time`. | xref:BloombergLP/bslfmt/FormatterBase_IsStdChronoPointInTimeType.adoc[`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. | xref:BloombergLP/bslfmt/FormatterBase_IsStdChronoSysTime-0d.adoc[`FormatterBase_IsStdChronoSysTime`] | Simple trait type that tells is `t_TYPE` is an instance of `std::chrono::sys_time`. | xref:BloombergLP/bslfmt/FormatterBase_IsStdChronoTaiTime-014.adoc[`FormatterBase_IsStdChronoTaiTime`] | Simple trait type that tells is `t_TYPE` is an instance of `std::chrono::tai_time`. | xref:BloombergLP/bslfmt/FormatterBase_IsStdChronoTimeType.adoc[`FormatterBase_IsStdChronoTimeType`] | Simple trait type that tells is `t_TYPE` is an instance of any of `std::chrono::*_time`. | xref:BloombergLP/bslfmt/FormatterBase_IsStdChronoUtcTime-0a7.adoc[`FormatterBase_IsStdChronoUtcTime`] | Simple trait type that tells is `t_TYPE` is an instance of `std::chrono::utc_time`. | xref:BloombergLP/bslfmt/FormatterBase_IsStdChronoZonedTime-034.adoc[`FormatterBase_IsStdChronoZonedTime`] | Simple trait type that tells is `t_TYPE` is an instance of `std::chrono::zoned_time`. | xref:BloombergLP/bslfmt/FormatterCharUtil-059.adoc[`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. | xref:BloombergLP/bslfmt/FormatterCharacter_CharacterOutput-0a.adoc[`FormatterCharacter_CharacterOutput`] | This struct provides a function that outputs the specified `value` to the specified `out`. | xref:BloombergLP/bslfmt/FormatterCharacter_MakeUnsigned-07.adoc[`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`. | xref:BloombergLP/bslfmt/FormatterFloating_Base.adoc[`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`. | xref:BloombergLP/bslfmt/FormatterIntegralBase.adoc[`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. | xref:BloombergLP/bslfmt/FormatterIntegral_Category-0c.adoc[`FormatterIntegral_Category`] | This struct provides a function that returns a category of the formatter in accordance with the (template parameter) `t_VALUE_TYPE`. | xref:BloombergLP/bslfmt/FormatterPointer_Nullptr.adoc[`FormatterPointer_Nullptr`] | This struct is a specialization of the `bsl::formatter` template for the `bsl::nullptr_t`. | xref:BloombergLP/bslfmt/FormatterSpecificationNumericValue.adoc[`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. | xref:BloombergLP/bslfmt/FormatterSpecificationNumericValue_ArgVisitor.adoc[`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. | xref:BloombergLP/bslfmt/FormatterString_GraphemeCluster.adoc[`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. | xref:BloombergLP/bslfmt/FormatterTestUtil-00.adoc[`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`. | xref:BloombergLP/bslfmt/FormatterTestUtil_Oracle-0ff.adoc[`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. | xref:BloombergLP/bslfmt/FormatterUnicodeData.adoc[`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. | xref:BloombergLP/bslfmt/MockFormatContext.adoc[`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. | xref:BloombergLP/bslfmt/MockFormatContext_Iterator.adoc[`MockFormatContext_Iterator`] | This class template provides an output iterator to the `MockFormatContext` output buffer allowing appending formatted data. | xref:BloombergLP/bslfmt/MockParseContext.adoc[`MockParseContext`] | This class template provides an access to the format specification current parsing state. | xref:BloombergLP/bslfmt/PadUtil.adoc[`PadUtil`] | This `struct` serves as a namespace for static functions related to padding output by bslfmt. | xref:BloombergLP/bslfmt/StandardFormatSpecification.adoc[`StandardFormatSpecification`] | A general mechanism to parse and validate a Standard format specification string for a given argument type. | xref:BloombergLP/bslfmt/Streamed-0f9.adoc[`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. | xref:BloombergLP/bslfmt/StreamedFormatter.adoc[`StreamedFormatter`] | This class provides the implementations of `parse` and `format` for formatters that format a type using its streaming operator. | xref:BloombergLP/bslfmt/Streamed_NoWarningConstructorTag.adoc[`Streamed_NoWarningConstructorTag`] | A _component private_ tag type used to internally construct a `Streamed` object without a warning (about an already existing formatter). | xref:BloombergLP/bslfmt/TestSpecificationGenerator.adoc[`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. | xref:BloombergLP/bslfmt/TestSpecificationGenerator_BoolOption.adoc[`TestSpecificationGenerator_BoolOption`] | This class is an implementation of the `TestSpecificationGenerator_Option` for options that have only two states: they are either present or not. | xref:BloombergLP/bslfmt/TestSpecificationGenerator_Option.adoc[`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. | xref:BloombergLP/bslfmt/TestSpecificationGenerator_TypedOption.adoc[`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. | xref:BloombergLP/bslfmt/UnicodeCodePoint.adoc[`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. | xref:BloombergLP/bslfmt/basic_format_arg-0d.adoc[`basic_format_arg`] | Type‐erased format argument holding a value for formatting. | xref:BloombergLP/bslfmt/basic_format_args.adoc[`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. | xref:BloombergLP/bslfmt/basic_format_context.adoc[`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. | xref:BloombergLP/bslfmt/basic_format_parse_context.adoc[`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. | xref:BloombergLP/bslfmt/basic_format_string.adoc[`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 [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslfmt/format_args.adoc[`format_args`] | Alias for `basic_format_args` specialized on a `char` format context. | xref:BloombergLP/bslfmt/format_context.adoc[`format_context`] | Alias for `basic_format_context` specialized on `char`. | xref:BloombergLP/bslfmt/format_parse_context.adoc[`format_parse_context`] | Alias for `basic_format_parse_context` specialized on `char`. | xref:BloombergLP/bslfmt/format_string.adoc[`format_string`] | Alias for a checked `char` format string. | xref:BloombergLP/bslfmt/wformat_args.adoc[`wformat_args`] | Alias for `basic_format_args` specialized on a `wchar_t` format context. | xref:BloombergLP/bslfmt/wformat_context.adoc[`wformat_context`] | Alias for `basic_format_context` specialized on `wchar_t`. | xref:BloombergLP/bslfmt/wformat_parse_context.adoc[`wformat_parse_context`] | Alias for `basic_format_parse_context` specialized on `wchar_t`. | xref:BloombergLP/bslfmt/wformat_string.adoc[`wformat_string`] | Alias for a checked `wchar_t` format string. |=== == Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslfmt/format-08.adoc[`format`] | `format` overloads | xref:BloombergLP/bslfmt/format_to-0b3.adoc[`format_to`] | `format_to` overloads | xref:BloombergLP/bslfmt/format_to_n-07.adoc[`format_to_n`] | Format `args` per `fmtStr` into `out`, writing at most `maxNumChars` characters. | xref:BloombergLP/bslfmt/formatted_size-00.adoc[`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. | xref:BloombergLP/bslfmt/make_format_args.adoc[`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. | xref:BloombergLP/bslfmt/make_wformat_args.adoc[`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. | xref:BloombergLP/bslfmt/print-054.adoc[`print`] | `print` overloads | xref:BloombergLP/bslfmt/println-0ce.adoc[`println`] | `println` overloads | xref:BloombergLP/bslfmt/streamed-07.adoc[`streamed`] | `streamed` overloads | xref:BloombergLP/bslfmt/swap.adoc[`swap`] | Exchange the values of the specified `lhs` and `rhs`. | xref:BloombergLP/bslfmt/vformat-0e.adoc[`vformat`] | `vformat` overloads | xref:BloombergLP/bslfmt/vformat_to-0f.adoc[`vformat_to`] | `vformat_to` overloads | xref:BloombergLP/bslfmt/visit_format_arg.adoc[`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}. | xref:BloombergLP/bslfmt/vprint_nonunicode-06.adoc[`vprint_nonunicode`] | `vprint_nonunicode` overloads | xref:BloombergLP/bslfmt/vprint_nonunicode_buffered.adoc[`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. | xref:BloombergLP/bslfmt/vprint_unicode-07.adoc[`vprint_unicode`] | `vprint_unicode` overloads | xref:BloombergLP/bslfmt/vprint_unicode_buffered.adoc[`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 [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslfmt/format_error.adoc[`format_error`] | Alias for `std::format_error` in the `bsl` namespace. | xref:BloombergLP/bslfmt/format_to_n_result.adoc[`format_to_n_result`] | Alias for `std::format_to_n_result` in the `bslfmt` namespace. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#