| 301 | } |
| 302 | |
| 303 | MMKVPath_t absolutePath(const MMKVPath_t& path) { |
| 304 | fs::path relative_path(path); |
| 305 | fs::path absolute_path = fs::absolute(relative_path); |
| 306 | try { |
| 307 | fs::path normalized = fs::weakly_canonical(absolute_path); |
| 308 | return normalized.wstring(); |
| 309 | } catch (std::exception &e) { |
| 310 | const auto &utf8Path = MMKVPath_t2String(absolute_path.wstring()); |
| 311 | MMKVError("fail to weakly_canonical() path %s, error: %s", utf8Path.c_str(), e.what()); |
| 312 | } |
| 313 | return absolute_path.wstring(); |
| 314 | } |
| 315 | |
| 316 | bool isFileExist(const MMKVPath_t &nsFilePath) { |
| 317 | if (nsFilePath.empty()) { |
nothing calls this directly
no test coverage detected