diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-10-17 21:50:24 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-10-17 21:50:24 +0800 |
| commit | 728d592f4075ae78b67dab6911ada05875a470a3 (patch) | |
| tree | 57a7232ea0a984b0344bc63a593c1dee65072d2f /include/cru/base | |
| parent | 045462a6aed2796976a2f5cf0042f9a0ac1493f7 (diff) | |
| download | cru-728d592f4075ae78b67dab6911ada05875a470a3.tar.gz cru-728d592f4075ae78b67dab6911ada05875a470a3.tar.bz2 cru-728d592f4075ae78b67dab6911ada05875a470a3.zip | |
Fix macOS build.
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 |
