aboutsummaryrefslogtreecommitdiff
path: root/src/common/StringUtil.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-17 20:49:37 +0800
committercrupest <crupest@outlook.com>2022-01-17 20:49:37 +0800
commit87658408858dfad8c1fc85b048d46b9a6345580d (patch)
tree03484fb8e64b31fe6e1f146771c423914b922e99 /src/common/StringUtil.cpp
parent0dd9ded17f0b8461d54ccfbc66886395fab0aa98 (diff)
downloadcru-87658408858dfad8c1fc85b048d46b9a6345580d.tar.gz
cru-87658408858dfad8c1fc85b048d46b9a6345580d.tar.bz2
cru-87658408858dfad8c1fc85b048d46b9a6345580d.zip
...
Diffstat (limited to 'src/common/StringUtil.cpp')
-rw-r--r--src/common/StringUtil.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/common/StringUtil.cpp b/src/common/StringUtil.cpp
index 6e478033..04435a0a 100644
--- a/src/common/StringUtil.cpp
+++ b/src/common/StringUtil.cpp
@@ -1,5 +1,4 @@
#include "cru/common/StringUtil.hpp"
-#include <functional>
#include "cru/common/Base.hpp"
#include "cru/common/Exception.hpp"
@@ -258,4 +257,13 @@ char16_t ToUpper(char16_t c) {
bool IsWhitespace(char16_t c) {
return c == u' ' || c == u'\t' || c == u'\n' || c == u'\r';
}
+
+Utf8CodePointIterator CreateUtf8Iterator(const std::byte* buffer, Index size) {
+ return Utf8CodePointIterator(reinterpret_cast<const char*>(buffer), size);
+}
+
+Utf8CodePointIterator CreateUtf8Iterator(const std::vector<std::byte>& buffer) {
+ return CreateUtf8Iterator(buffer.data(), buffer.size());
+}
+
} // namespace cru