Represents log message argument formatting interface. More...
#include <kanzi/core/log/log_argument_format.hpp>
Public Member Functions | |
const char * | getFormatString () const |
Returns printf format string that is used with sprintf to convert the value to string. More... | |
Static Public Member Functions | |
template<typename T > | |
static enable_if< LogArgumentSupportsFormatting< T >::value, string >::type | convertToString (string_view formatString, const void *valueVoidReference) |
Uses type information of the argument to convert pointer to the value to string representation of the value. More... | |
template<typename T > | |
static enable_if<!LogArgumentSupportsFormatting< T >::value, string >::type | convertToString (string_view formatString, const void *valueVoidReference) |
Uses type information of the argument to convert pointer to the value to string representation of the value. More... | |
Represents log message argument formatting interface.
This class incapsulates interface used by ::detail::kanzi::LogArgumentTypeEraser and ::detail::LogRecord to convert the log message format argument to string. For details, see Log message formating.
typedef string(* kanzi::detail::LogArgumentFormat::ConversionFunction) (string_view formatString, const void *value) |
Declares pointer type to function used to convert void argument pointer to string.
typedef optional<PresentationTypeSpecifier> kanzi::detail::LogArgumentFormat::OptionalPresentationTypeSpecifier |
Optional presentation type specifier.
typedef string_view(* kanzi::detail::LogArgumentFormat::PresentationTypeSpecifierToStringConversionFunction) (OptionalPresentationTypeSpecifier presentationTypeSpecifier) |
The pointer type to the function that converts type presentation specifier to printf specifier.
Enumerates various presentation types supported by the formatting.
|
inlinestatic |
Uses type information of the argument to convert pointer to the value to string representation of the value.
The argument value is converted according to format string supplied. This template function is only instantiated for the types that support formatting, i.e. integral types, pointers, arrays but not user defined types.
formatString | The format specification. |
valueVoidReference | The pointer to the argument value. |
|
inlinestatic |
Uses type information of the argument to convert pointer to the value to string representation of the value.
The argument value is converted according to format string supplied. This template function is instantiated for types that do not support formatting, i.e. user defined types.
formatString | The format specification. |
valueVoidReference | The pointer to the argument value. |
|
inline |
Returns printf format string that is used with sprintf to convert the value to string.
For details, see LogArgumentFormat().