diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-08-16 19:24:11 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-08-16 19:24:11 +0800 |
commit | 600307d3d0133accc3aaceed694e897ad48cd584 (patch) | |
tree | 21296dcabd1868872b0e2ab06c17ce1d6cbf1df3 /include | |
parent | d868d7b0d463ede80b761f87f10d4e25f52989c3 (diff) | |
download | cru-600307d3d0133accc3aaceed694e897ad48cd584.tar.gz cru-600307d3d0133accc3aaceed694e897ad48cd584.tar.bz2 cru-600307d3d0133accc3aaceed694e897ad48cd584.zip |
Move Core Foundation string out of cru String. Still error.
Diffstat (limited to 'include')
-rw-r--r-- | include/cru/base/Osx.h | 9 | ||||
-rw-r--r-- | include/cru/base/String.h | 14 |
2 files changed, 7 insertions, 16 deletions
diff --git a/include/cru/base/Osx.h b/include/cru/base/Osx.h index 711da9a3..057302c2 100644 --- a/include/cru/base/Osx.h +++ b/include/cru/base/Osx.h @@ -1,9 +1,11 @@ #pragma once -#ifndef CRU_PLATFORM_OSX -#error "This header can only be included on OSX." +#ifndef __APPLE__ +#error "This header can only be included on OSX platforms." #endif +#include "String.h" + #include <CoreFoundation/CoreFoundation.h> namespace cru { @@ -23,4 +25,7 @@ class CFWrapper { return ref; } }; + +CFWrapper<CFStringRef> ToCFStringRef(StringView string); +String FromCFStringRef(CFStringRef string); } // namespace cru diff --git a/include/cru/base/String.h b/include/cru/base/String.h index 49c96c4a..21a3db51 100644 --- a/include/cru/base/String.h +++ b/include/cru/base/String.h @@ -14,11 +14,6 @@ #include <type_traits> #include <vector> -#ifdef CRU_PLATFORM_OSX -#include <CoreFoundation/CoreFoundation.h> -#include <cru/base/Osx.h> -#endif - namespace cru { class StringView; @@ -242,11 +237,6 @@ class CRU_BASE_API String { } #endif -#ifdef CRU_PLATFORM_OSX - CFWrapper<CFStringRef> ToCFStringRef() const; - static String FromCFStringRef(CFStringRef string); -#endif - template <typename... T> String Format(T&&... args) const; @@ -390,10 +380,6 @@ class CRU_BASE_API StringView { std::string ToUtf8() const; Buffer ToUtf8Buffer(bool end_zero = true) const; -#ifdef CRU_PLATFORM_OSX - CFWrapper<CFStringRef> ToCFStringRef() const; -#endif - private: const char16_t* ptr_; Index size_; |