Use filesystem

This commit is contained in:
Alexander Batalov 2022-05-28 10:33:03 +03:00
parent 151f438dde
commit 3ed371dd36
3 changed files with 10 additions and 5 deletions

View File

@ -7,6 +7,9 @@
#include "obj_types.h"
#include "proto_types.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
typedef enum Head {
HEAD_INVALID,
HEAD_MARCUS,

View File

@ -9,6 +9,9 @@
#include <stdio.h>
#include <string.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
// 0x5108C0
AudioFileIsCompressedProc* _queryCompressedFunc_2 = _defaultCompressionFunc__;

View File

@ -5,7 +5,8 @@
#include <stdio.h>
#include <zlib.h>
#include <fstream>
#include <filesystem>
// 0x452740
int fileCopyDecompressed(const char* existingFilePath, const char* newFilePath)
@ -142,8 +143,6 @@ int _gzdecompress_file(const char* existingFilePath, const char* newFilePath)
void fileCopy(const char* existingFilePath, const char* newFilePath)
{
std::ifstream source { existingFilePath, std::ios::binary };
std::ofstream destination { newFilePath, std::ios::binary };
destination << source.rdbuf();
std::error_code ec;
std::filesystem::copy_file(std::filesystem::path(existingFilePath), std::filesystem::path(newFilePath), ec);
}