MCPcopy Create free account
hub / github.com/catboost/catboost / WinRename

Function WinRename

util/system/fs_win.cpp:43–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 }
42
43 bool WinRename(const TString& oldPath, const TString& newPath) {
44 TUtf16String op, np;
45 LPCWSTR opPtr = UTF8ToWCHAR(oldPath, op);
46 LPCWSTR npPtr = UTF8ToWCHAR(newPath, np);
47 if (!opPtr || !npPtr) {
48 ::SetLastError(ERROR_INVALID_NAME);
49 return false;
50 }
51
52 return MoveFileExW(opPtr, npPtr, MOVEFILE_REPLACE_EXISTING) != 0;
53 }
54
55 bool WinRemove(const TString& path) {
56 TUtf16String wstr;

Callers 1

RenameMethod · 0.85

Calls 1

UTF8ToWCHARFunction · 0.70

Tested by

no test coverage detected