diff options
author | crupest <crupest@outlook.com> | 2020-10-28 17:44:06 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-10-28 17:44:06 +0800 |
commit | 864b031211322dc276b220ec0a6e11483503a0e9 (patch) | |
tree | c5c0aa1a046b443dc001445f39870cb440b6fe38 /include/cru/common | |
parent | 2df47ffbfff02fb6b64d19e404adc41a93677afe (diff) | |
download | cru-864b031211322dc276b220ec0a6e11483503a0e9.tar.gz cru-864b031211322dc276b220ec0a6e11483503a0e9.tar.bz2 cru-864b031211322dc276b220ec0a6e11483503a0e9.zip |
...
Diffstat (limited to 'include/cru/common')
-rw-r--r-- | include/cru/common/StringUtil.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 <string> #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 |