1. NameSpace almost work on iOS

2. Upgrade to iOS 13, watchOS 6
3. Dont mkPath() on ReadOnly mode
This commit is contained in:
guoling
2024-11-28 17:22:00 +08:00
parent beff34f7ac
commit 89b56922e8
9 changed files with 189 additions and 53 deletions
+9
View File
@@ -36,8 +36,10 @@
# include <dirent.h>
# include <cstring>
# include <unistd.h>
# include <filesystem>
using namespace std;
namespace fs = std::filesystem;
namespace mmkv {
@@ -418,6 +420,13 @@ size_t getPageSize() {
return static_cast<size_t>(getpagesize());
}
extern MMKVPath_t absolutePath(const MMKVPath_t &path) {
fs::path relative_path(path);
fs::path absolute_path = fs::absolute(relative_path);
fs::path normalized = fs::weakly_canonical(absolute_path);
return normalized.string();
}
#ifndef MMKV_APPLE
static pair<MMKVPath_t, int> createUniqueTempFile(const char *prefix) {