mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add util::length_utf8
This commit is contained in:
parent
52ed1abf1c
commit
f3181dee88
2 changed files with 16 additions and 1 deletions
|
|
@ -44,6 +44,11 @@ namespace util {
|
|||
/// @param maxSize max encoded string length after crop
|
||||
/// @return cropped string size (less or equal to maxSize)
|
||||
size_t crop_utf8(std::string_view s, size_t maxSize);
|
||||
|
||||
/// @brief Measure utf8-encoded string length
|
||||
/// @param s source encoded string
|
||||
/// @return unicode string length (number of codepoints)
|
||||
size_t length_utf8(std::string_view s);
|
||||
|
||||
bool is_integer(const std::string& text);
|
||||
bool is_integer(const std::wstring& text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue