From 864b031211322dc276b220ec0a6e11483503a0e9 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 28 Oct 2020 17:44:06 +0800 Subject: ... --- include/cru/common/StringUtil.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/cru/common') diff --git a/include/cru/common/StringUtil.hpp b/include/cru/common/StringUtil.hpp index 5dacfa12..276048f5 100644 --- a/include/cru/common/StringUtil.hpp +++ b/include/cru/common/StringUtil.hpp @@ -1,4 +1,5 @@ #pragma once +#include #include "Base.hpp" namespace cru { @@ -124,4 +125,7 @@ void Utf16EncodeCodePointAppend(CodePoint code_point, std::u16string& str); std::string ToUtf8(std::u16string_view s); std::u16string ToUtf16(std::string_view s); + +// If given s is not a valid utf16 string, return value is UD. +bool Utf16IsValidInsertPosition(std::u16string_view s, gsl::index position); } // namespace cru -- cgit v1.2.3