Port the 21-function Os file API (OsCreateFile, OsReadFile, OsFileList, ...). OsCreateDirectory and OsSetCurrentDirectory move here from Path. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
48 lines
1.9 KiB
C++
48 lines
1.9 KiB
C++
#ifndef ENGINE_SOURCE_OS_OSFILE_H
|
|
#define ENGINE_SOURCE_OS_OSFILE_H
|
|
|
|
#include <cstdint>
|
|
#include "Engine/Source/BlizzardCore/Source/System/File/Types.h"
|
|
|
|
struct HOSFILE__;
|
|
typedef HOSFILE__* HOSFILE;
|
|
|
|
struct OS_FILE_DATA {
|
|
/* 0000 */ uint32_t size;
|
|
/* 0004 */ uint32_t flags;
|
|
/* 0008 */ char fileName[260];
|
|
};
|
|
|
|
typedef int32_t (*OsFileListCallback)(OS_FILE_DATA& data, void* param);
|
|
|
|
struct OsFileList_Internal {
|
|
/* 0000 */ OsFileListCallback m_callback;
|
|
/* 0004 */ void* m_param;
|
|
/* 0008 */ int32_t m_includeHidden;
|
|
/* 000C */ const char* m_pattern;
|
|
|
|
static bool Callback(const Blizzard::File::ProcessDirParms& parms);
|
|
};
|
|
|
|
bool OsCloseFile(HOSFILE file);
|
|
int32_t OsCopyFile(const char* existingFileName, const char* newFileName, int32_t failIfExists);
|
|
int32_t OsCreateDirectory(const char* pathName, int32_t recursive);
|
|
HOSFILE OsCreateFile(const char* fileName, uint32_t desiredAccess, uint32_t shareMode, uint32_t createDisposition, uint32_t flagsAndAttributes, uint32_t extendedFileType);
|
|
int32_t OsDeleteFile(const char* fileName);
|
|
int32_t OsDirectoryExists(const char* pathName);
|
|
int32_t OsFileExists(const char* fileName);
|
|
char* OsFileGetDownloadFolder();
|
|
int32_t OsFileList(const char* dir, const char* pattern, OsFileListCallback callback, void* param, int32_t includeHidden);
|
|
int32_t OsGetCurrentDirectory(uint32_t bufferSize, char* buffer);
|
|
uint32_t OsGetFileAttributes(const char* fileName);
|
|
uint64_t OsGetFileSize(HOSFILE file);
|
|
int32_t OsMoveFile(const char* existingFileName, const char* newFileName);
|
|
int32_t OsReadFile(HOSFILE file, void* buffer, uint32_t bytesToRead, uint32_t* bytesRead);
|
|
int32_t OsRemoveDirectory(const char* pathName);
|
|
int32_t OsRemoveDirectoryRecurse(const char* pathName, uint32_t flags);
|
|
bool OsSetCurrentDirectory(const char* path);
|
|
int32_t OsSetFileAttributes(const char* fileName, uint32_t attributes);
|
|
int32_t OsWriteFile(HOSFILE file, const void* buffer, uint32_t bytesToWrite, uint32_t* bytesWritten);
|
|
|
|
#endif
|