[win] moving Utils to 'platform_win' folder and refactoring

This commit is contained in:
SimplestStudio
2023-04-14 22:01:46 +03:00
parent 5b1556d07e
commit 09ca2ae538
2 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,7 @@
*
*/
#include "utils.h"
#include "platform_win/utils.h"
#include "version.h"
#include <Windows.h>
#include <shellapi.h>
@ -52,6 +52,7 @@
#define BUFSIZE 1024
namespace NS_Utils
{
wstring GetLastErrorAsString()
@ -260,8 +261,8 @@ namespace NS_File
bool replaceFile(const wstring &oldFilePath, const wstring &newFilePath)
{
return MoveFileExW(oldFilePath.c_str(), newFilePath.c_str(),
MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH) != 0 ? true : false;
return MoveFileEx(oldFilePath.c_str(), newFilePath.c_str(), MOVEFILE_REPLACE_EXISTING |
MOVEFILE_WRITE_THROUGH | MOVEFILE_COPY_ALLOWED) != 0 ? true : false;
}
bool replaceFolder(const wstring &from, const wstring &to, bool remove_existing)