MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / MoveFile

Method MoveFile

Source/Engine/Platform/Win32/Win32FileSystem.cpp:204–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204bool Win32FileSystem::MoveFile(const StringView& dst, const StringView& src, bool overwrite)
205{
206 const DWORD flags = MOVEFILE_COPY_ALLOWED | (overwrite ? MOVEFILE_REPLACE_EXISTING : 0);
207 WIN32_INIT_BUFFER(dst, bufferDst);
208 WIN32_INIT_BUFFER(src, bufferSrc);
209
210 // If paths are almost the same but some characters have different case we need to use a proxy file
211 if (dst.Length() == src.Length() && StringUtils::CompareIgnoreCase(*dst, *src) == 0)
212 {
213 String tmp;
214 GetTempFilePath(tmp);
215 return MoveFileExW(bufferSrc, *tmp, MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING) == 0 || MoveFileExW(*tmp, bufferDst, flags) == 0;
216 }
217
218 return MoveFileExW(bufferSrc, bufferDst, flags) == 0;
219}
220
221bool Win32FileSystem::CopyFile(const StringView& dst, const StringView& src)
222{

Callers

nothing calls this directly

Calls 1

LengthMethod · 0.45

Tested by

no test coverage detected