diff options
Diffstat (limited to 'include/cru/base')
-rw-r--r-- | include/cru/base/Osx.h | 7 | ||||
-rw-r--r-- | include/cru/base/StringUtil.h | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/include/cru/base/Osx.h b/include/cru/base/Osx.h index fbdffc54..e42a4fe5 100644 --- a/include/cru/base/Osx.h +++ b/include/cru/base/Osx.h @@ -7,9 +7,10 @@ #endif #include "Range.h" -#include "String.h" #include <CoreFoundation/CoreFoundation.h> +#include <string> +#include <string_view> namespace cru { template <typename CFClassRef> @@ -29,8 +30,8 @@ class CFWrapper { } }; -CFWrapper<CFStringRef> ToCFString(StringView string); -String FromCFStringRef(CFStringRef string); +CFWrapper<CFStringRef> ToCFString(std::string_view string); +std::string FromCFStringRef(CFStringRef string); CFRange ToCFRange(const Range& range); Range FromCFRange(const CFRange& range); diff --git a/include/cru/base/StringUtil.h b/include/cru/base/StringUtil.h index 54e7b6e6..8c7841d7 100644 --- a/include/cru/base/StringUtil.h +++ b/include/cru/base/StringUtil.h @@ -375,4 +375,9 @@ class CodePointIterator { using Utf8CodePointIterator = CodePointIterator<char, &Utf8NextCodePoint>; using Utf16CodePointIterator = CodePointIterator<Utf16CodeUnit, &Utf16NextCodePoint>; + +Index Utf8IndexCodeUnitToCodePoint(const Utf8CodeUnit* ptr, Index size, Index position); +Index Utf8IndexCodePointToCodeUnit(const Utf8CodeUnit* ptr, Index size, Index position); +Index Utf16IndexCodeUnitToCodePoint(const Utf16CodeUnit* ptr, Index size, Index position); +Index Utf16IndexCodePointToCodeUnit(const Utf16CodeUnit* ptr, Index size, Index position); } // namespace cru::string |