|
|
@ -1,4 +1,4 @@
|
|
|
|
// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
|
|
|
|
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
|
|
|
|
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
|
|
|
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#pragma once
|
|
|
@ -98,6 +98,8 @@ public:
|
|
|
|
template<typename... T>
|
|
|
|
template<typename... T>
|
|
|
|
void format(fmt::format_string<T...> fmt, T&&... args);
|
|
|
|
void format(fmt::format_string<T...> fmt, T&&... args);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void vformat(fmt::string_view fmt, fmt::format_args args);
|
|
|
|
|
|
|
|
|
|
|
|
// compare one string to another
|
|
|
|
// compare one string to another
|
|
|
|
bool equals(const char* str) const;
|
|
|
|
bool equals(const char* str) const;
|
|
|
|
bool equals(const SmallStringBase& str) const;
|
|
|
|
bool equals(const SmallStringBase& str) const;
|
|
|
@ -316,6 +318,8 @@ public:
|
|
|
|
template<typename... T>
|
|
|
|
template<typename... T>
|
|
|
|
static SmallStackString from_format(fmt::format_string<T...> fmt, T&&... args);
|
|
|
|
static SmallStackString from_format(fmt::format_string<T...> fmt, T&&... args);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static SmallStackString from_vformat(fmt::string_view fmt, fmt::format_args args);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
char m_stack_buffer[L + 1];
|
|
|
|
char m_stack_buffer[L + 1];
|
|
|
|
|
|
|
|
|
|
|
@ -360,6 +364,14 @@ ALWAYS_INLINE SmallStackString<L> SmallStackString<L>::from_format(fmt::format_s
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<u32 L>
|
|
|
|
|
|
|
|
ALWAYS_INLINE SmallStackString<L> SmallStackString<L>::from_vformat(fmt::string_view fmt, fmt::format_args args)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SmallStackString<L> ret;
|
|
|
|
|
|
|
|
fmt::vformat_to(std::back_inserter(ret), fmt, args);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// stack string types
|
|
|
|
// stack string types
|
|
|
|
using TinyString = SmallStackString<64>;
|
|
|
|
using TinyString = SmallStackString<64>;
|
|
|
|
using SmallString = SmallStackString<256>;
|
|
|
|
using SmallString = SmallStackString<256>;
|
|
|
|