SmallString: Add append_vformat()

This commit is contained in:
Stenzek 2024-12-24 13:16:12 +10:00
parent 86d78e5eca
commit f4265edb2d
No known key found for this signature in database
2 changed files with 6 additions and 1 deletions

View File

@ -526,6 +526,11 @@ std::span<u8> SmallStringBase::bspan()
return std::span<u8>(reinterpret_cast<u8*>(m_buffer), m_length);
}
void SmallStringBase::append_vformat(fmt::string_view fmt, fmt::format_args args)
{
fmt::vformat_to(std::back_inserter(*this), fmt, args);
}
void SmallStringBase::vformat(fmt::string_view fmt, fmt::format_args args)
{
clear();

View File

@ -66,6 +66,7 @@ public:
template<typename... T>
void append_format(fmt::format_string<T...> fmt, T&&... args);
void append_vformat(fmt::string_view fmt, fmt::format_args args);
// append hex string
void append_hex(const void* data, size_t len, bool comma_separate = false);
@ -100,7 +101,6 @@ public:
template<typename... T>
void format(fmt::format_string<T...> fmt, T&&... args);
void vformat(fmt::string_view fmt, fmt::format_args args);
// compare one string to another