18 template <
typename ArgFormatter>
20 const char *&format_str,
const std::tm &tm)
22 if (*format_str ==
':')
24 const char *
end = format_str;
25 while (*end && *end !=
'}')
30 format.
append(format_str, end + 1);
31 format[format.
size() - 1] =
'\0';
36 std::size_t size = buffer.
capacity() - start;
37 std::size_t
count = std::strftime(&buffer[start], size, &format[0], &tm);
40 buffer.
resize(start + count);
43 if (size >= format.
size() * 256)
51 const std::size_t MIN_GROWTH = 10;
52 buffer.
reserve(buffer.
capacity() + (size > MIN_GROWTH ? size : MIN_GROWTH));
void resize(std::size_t new_size)
std::string format(CStringRef format_str, ArgList args)
std::size_t capacity() const
void append(const U *begin, const U *end)
void reserve(std::size_t capacity)