Core/StringExt: Add IterateOnCodepoints to remove std::u32string allocations

This commit is contained in:
SirLynix
2023-08-24 08:42:25 +02:00
parent bd53245f42
commit ad738a2803
6 changed files with 187 additions and 164 deletions

View File

@@ -10,6 +10,7 @@
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Unicode.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <NazaraUtils/FunctionRef.hpp>
#include <string>
namespace Nz
@@ -35,6 +36,8 @@ namespace Nz
inline bool IsNumber(std::string_view str);
NAZARA_CORE_API void IterateOnCodepoints(std::string_view str, FunctionRef<bool(const char32_t* characters, std::size_t characterCount)> callback);
NAZARA_CORE_API bool MatchPattern(std::string_view str, std::string_view pattern);
inline std::string NumberToString(long long number, UInt8 radix = 10);