Attempts to format a string to a buffer before falling back to a dynamically allocated string.
More...
#include <Format.h>
|
const char * | format (const char *formatStr,...) CHECK_PRINTF_FORMAT_STRING(2 |
| Formats a string using a printf-style format string. More...
|
|
const char const char * | formatv (const char *formatStr, va_list args) |
| Formats a string using a printf-style format string with an already created va_list . More...
|
|
const char * | formatLocalTime (const TimePoint ×tamp) |
| Creates a string for a timestamp using local time with the default format string. More...
|
|
const char * | formatLocalTime (const TimePoint ×tamp, const char *formatStr) |
| Creates a string for a timestamp using local time. More...
|
|
const char * | formatUtcTime (const TimePoint ×tamp) |
| Creates a string for a timestamp using the UTC time standard with the default format string. More...
|
|
const char * | formatUtcTime (const TimePoint ×tamp, const char *formatStr) |
| Creates a string for a timestamp using the UTC time standard. More...
|
|
|
std::string | logging::formatv (const char *formatStr, va_list args) |
|
Attempts to format a string to a buffer before falling back to a dynamically allocated string.
This can be used to avoid allocating std::string
for smaller strings.
◆ format()
const char* olp::logging::FormatBuffer::format |
( |
const char * |
formatStr, |
|
|
|
... |
|
) |
| |
Formats a string using a printf-style format string.
- Parameters
-
formatStr | The format string. |
- Returns
- The formatted string.
◆ formatLocalTime() [1/2]
const char* olp::logging::FormatBuffer::formatLocalTime |
( |
const TimePoint & |
timestamp | ) |
|
Creates a string for a timestamp using local time with the default format string.
The default format string is Y-m-d H:M:S
.
- Parameters
-
timestamp | The timestamp to format as seconds from epoch. |
- Returns
- The formatted string.
◆ formatLocalTime() [2/2]
const char* olp::logging::FormatBuffer::formatLocalTime |
( |
const TimePoint & |
timestamp, |
|
|
const char * |
formatStr |
|
) |
| |
Creates a string for a timestamp using local time.
- Parameters
-
timestamp | The timestamp to format as seconds from epoch. |
formatStr | The format string to use, conforming to strftime. |
- Returns
- The formatted string.
◆ formatUtcTime() [1/2]
const char* olp::logging::FormatBuffer::formatUtcTime |
( |
const TimePoint & |
timestamp | ) |
|
Creates a string for a timestamp using the UTC time standard with the default format string.
The default format string is Y-m-d H:M:S
.
- Parameters
-
timestamp | The timestamp to format as seconds from epoch. |
- Returns
- The formatted string.
◆ formatUtcTime() [2/2]
const char* olp::logging::FormatBuffer::formatUtcTime |
( |
const TimePoint & |
timestamp, |
|
|
const char * |
formatStr |
|
) |
| |
Creates a string for a timestamp using the UTC time standard.
- Parameters
-
timestamp | The timestamp to format as seconds from epoch. |
formatStr | The format string to use, conforming to strftime. |
- Returns
- The formatted string.
◆ formatv()
const char const char* olp::logging::FormatBuffer::formatv |
( |
const char * |
formatStr, |
|
|
va_list |
args |
|
) |
| |
Formats a string using a printf-style format string with an already created va_list
.
- Parameters
-
formatStr | The format string. |
args | The va_list that contains the arguments. |
- Returns
- The formatted string.
The documentation for this class was generated from the following file:
- olp-cpp-sdk-core/include/olp/core/logging/Format.h