MCPcopy Create free account
hub / github.com/Tencent/MMKV / getUniqueFileName

Function getUniqueFileName

Core/MemoryFile_Win32.cpp:661–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661std::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

Callers

nothing calls this directly

Calls 1

MMKVPath_t2StringFunction · 0.85

Tested by

no test coverage detected