| 659 | } |
| 660 | |
| 661 | std::optional<MMKVPath_t> getUniqueFileName(const MMKVPath_t &folder, const MMKVPath_t &prefix) { |
| 662 | // Buffer for the resulting path |
| 663 | wchar_t tempFileName[MAX_PATH]; |
| 664 | UINT uUnique = 0; |
| 665 | |
| 666 | UINT result = GetTempFileName(folder.c_str(), prefix.c_str(), uUnique, tempFileName); |
| 667 | if (result == 0) { |
| 668 | const auto &utf8Folder = MMKVPath_t2String(folder); |
| 669 | MMKVError("failed to GetTempFileName file [%s], %d", utf8Folder.c_str(), GetLastError()); |
| 670 | return std::nullopt; |
| 671 | } |
| 672 | |
| 673 | return std::wstring(tempFileName); |
| 674 | } |
| 675 | |
| 676 | } // namespace mmkv |
| 677 |
nothing calls this directly
no test coverage detected