5#include "Containers/Array.h"
6#include "Containers/ContainersFwd.h"
7#include "Containers/UnrealString.h"
9#include "GenericPlatform/GenericPlatformFile.h"
10#include "HAL/FileManager.h"
11#include "HAL/PlatformFileManager.h"
12#include "Misc/DateTime.h"
13#include "Serialization/Archive.h"
14#include "Templates/UniquePtr.h"
16#ifndef PLATFORM_FILE_READER_BUFFER_SIZE
17 #define PLATFORM_FILE_READER_BUFFER_SIZE 1024
20#ifndef PLATFORM_FILE_WRITER_BUFFER_SIZE
21 #define PLATFORM_FILE_WRITER_BUFFER_SIZE 4096
24#ifndef PLATFORM_DEBUG_FILE_WRITER_BUFFER_SIZE
25 #define PLATFORM_DEBUG_FILE_WRITER_BUFFER_SIZE 4096
29
30
31
32
33
34
47
48
52
53
89 bool Delete(
const TCHAR* Filename,
bool RequireExists=0,
bool EvenReadOnly=0,
bool Quiet=0 )
override;
91 bool Move(
const TCHAR* Dest,
const TCHAR* Src,
bool Replace=1,
bool EvenIfReadOnly=0,
bool Attributes=0,
bool bDoNotRetryOrError=0 )
override;
94 void FindFiles( TArray<FString>& Result,
const TCHAR* Filename,
bool Files,
bool Directories )
override;
95 void FindFilesRecursive( TArray<FString>& FileNames,
const TCHAR* StartDirectory,
const TCHAR* Filename,
bool Files,
bool Directories,
bool bClearFileNames=
true)
override;
105 virtual bool DeleteDirectory(
const TCHAR* Path,
bool RequireExists=0,
bool Tree=0 )
override;
110
111
112
113
114
115
116
117
118
119 virtual void FindFiles(TArray<FString>& FoundFiles,
const TCHAR* Directory,
const TCHAR* FileExtension =
nullptr)
override;
122
123
124
125
126
131
132
133
134
135
140
141
142
143
144
149
150
151
152
153
158
159
160
161
162
166
167
168
169
170
174
175
176
177
178
182
183
184
185
186
190
191
192
193
194
198
199
200
201
202
203
214
215
218 void FindFilesRecursiveInternal( TArray<FString>& FileNames,
const TCHAR* StartDirectory,
const TCHAR* Filename,
bool Files,
bool Directories);
223
224
232 virtual void Seek( int64 InPos )
override final;
233 virtual int64
Tell()
override final
241 virtual bool Close()
override final;
242 virtual void Serialize(
void* V, int64 Length )
override final;
249 virtual bool Precache(int64 PrecacheOffset, int64 PrecacheSize)
override;
254
255
256
257
262
263
264
265
266
267 virtual void ReadLowLevel(uint8* Dest, int64 CountToRead, int64& OutBytesRead);
282
283
284
295 friend class FArchiveFileReaderGenericTest;
300
301
309 virtual void Seek( int64 InPos )
override final;
310 virtual int64
Tell()
override final
315 virtual bool Close()
override final;
316 virtual void Serialize(
void* V, int64 Length )
override final;
317 virtual void Flush()
override final;
325
326
327
328
331
332
333
334
337
338
339
342
343
344
345
346
350
351
352
353
354
355
#define ALLOW_DEBUG_FILES
#define PLATFORM_FILE_WRITER_BUFFER_SIZE
#define PLATFORM_FILE_READER_BUFFER_SIZE
virtual bool SeekLowLevel(int64 InPos)
@ bPrecacheAsSoonAsPossible
~FArchiveFileReaderGeneric()
virtual void FlushCache() override final
virtual void ReadLowLevel(uint8 *Dest, int64 CountToRead, int64 &OutBytesRead)
TUniquePtr< IFileHandle > Handle
FArchiveFileReaderGeneric(IFileHandle *InHandle, const TCHAR *InFilename, int64 InSize, uint32 InBufferSize=PLATFORM_FILE_READER_BUFFER_SIZE, uint32 InFlags=FILEREAD_None)
bool InternalPrecache(int64 PrecacheOffset, int64 PrecacheSize)
virtual FString GetArchiveName() const override
virtual bool Precache(int64 PrecacheOffset, int64 PrecacheSize) override
virtual void CloseLowLevel()
virtual void Seek(int64 InPos) override final
virtual int64 Tell() override final
TArray64< uint8 > BufferArray
virtual void Serialize(void *V, int64 Length) override final
virtual bool Close() override final
virtual int64 TotalSize() override final
virtual FString GetArchiveName() const override
virtual int64 TotalSize() override
void LogWriteError(const TCHAR *Message)
virtual int64 Tell() override final
virtual bool WriteLowLevel(const uint8 *Src, int64 CountToWrite)
virtual bool Close() override final
TUniquePtr< IFileHandle > Handle
virtual void Seek(int64 InPos) override final
virtual bool SeekLowLevel(int64 InPos)
~FArchiveFileWriterGeneric()
virtual void Serialize(void *V, int64 Length) override final
TArray64< uint8 > BufferArray
FArchiveFileWriterGeneric(IFileHandle *InHandle, const TCHAR *InFilename, int64 InPos, uint32 InBufferSize=PLATFORM_FILE_WRITER_BUFFER_SIZE, uint32 InFlags=FILEWRITE_None)
virtual bool CloseLowLevel()
virtual void Flush() override final
double GetFileAgeSeconds(const TCHAR *Filename) override
void FindFilesRecursiveInternal(TArray< FString > &FileNames, const TCHAR *StartDirectory, const TCHAR *Filename, bool Files, bool Directories)
bool IterateDirectoryRecursively(const TCHAR *Directory, IPlatformFile::FDirectoryVisitorFunc Visitor) override
int64 FileSize(const TCHAR *Filename) override
FArchive * CreateFileReaderInternal(const TCHAR *Filename, uint32 ReadFlags, uint32 BufferSize)
FString ConvertToAbsolutePathForExternalAppForWrite(const TCHAR *Filename) override
FArchive * CreateFileWriterInternal(const TCHAR *Filename, uint32 WriteFlags, uint32 BufferSize)
virtual ~FFileManagerGeneric()
FDateTime GetTimeStamp(const TCHAR *Filename) override
FArchive * CreateFileReader(const TCHAR *Filename, uint32 ReadFlags=0) override
bool IsReadOnly(const TCHAR *Filename) override
bool IterateDirectoryStatRecursively(const TCHAR *Directory, IPlatformFile::FDirectoryStatVisitorFunc Visitor) override
static FString DefaultConvertToRelativePath(const TCHAR *Filename)
void GetTimeStampPair(const TCHAR *PathA, const TCHAR *PathB, FDateTime &OutTimeStampA, FDateTime &OutTimeStampB)
virtual void ProcessCommandLineOptions() override
bool IterateDirectoryStatRecursively(const TCHAR *Directory, IPlatformFile::FDirectoryStatVisitor &Visitor) override
bool IterateDirectory(const TCHAR *Directory, IPlatformFile::FDirectoryVisitor &Visitor) override
FORCEINLINE IPlatformFile & GetLowLevel() const
virtual void SetSandboxEnabled(bool bInEnabled) override
virtual bool MakeDirectory(const TCHAR *Path, bool Tree=0) override
bool DirectoryExists(const TCHAR *InDirectory) override
bool IterateDirectoryRecursively(const TCHAR *Directory, IPlatformFile::FDirectoryVisitor &Visitor) override
virtual uint32 Copy(const TCHAR *Dest, const TCHAR *Src, bool Replace=1, bool EvenIfReadOnly=0, bool Attributes=0, FCopyProgress *Progress=nullptr, EFileRead ReadFlags=FILEREAD_None, EFileWrite WriteFlags=FILEWRITE_None) override
bool FileExists(const TCHAR *Filename) override
bool Delete(const TCHAR *Filename, bool RequireExists=0, bool EvenReadOnly=0, bool Quiet=0) override
bool IterateDirectoryStat(const TCHAR *Directory, IPlatformFile::FDirectoryStatVisitor &Visitor) override
virtual bool IsSandboxEnabled() const override
virtual bool DeleteDirectory(const TCHAR *Path, bool RequireExists=0, bool Tree=0) override
virtual FString GetFilenameOnDisk(const TCHAR *Filename) override
void FindFilesRecursive(TArray< FString > &FileNames, const TCHAR *StartDirectory, const TCHAR *Filename, bool Files, bool Directories, bool bClearFileNames=true) override
virtual bool SendMessageToServer(const TCHAR *Message, IPlatformFile::IFileServerMessageHandler *Handler) override
bool IterateDirectory(const TCHAR *Directory, IPlatformFile::FDirectoryVisitorFunc Visitor) override
void FindFiles(TArray< FString > &Result, const TCHAR *Filename, bool Files, bool Directories) override
bool IterateDirectoryStat(const TCHAR *Directory, IPlatformFile::FDirectoryStatVisitorFunc Visitor) override
virtual void FindFiles(TArray< FString > &FoundFiles, const TCHAR *Directory, const TCHAR *FileExtension=nullptr) override
bool Move(const TCHAR *Dest, const TCHAR *Src, bool Replace=1, bool EvenIfReadOnly=0, bool Attributes=0, bool bDoNotRetryOrError=0) override
bool SetTimeStamp(const TCHAR *Filename, FDateTime Timestamp) override
FString ConvertToRelativePath(const TCHAR *Filename) override
FDateTime GetAccessTimeStamp(const TCHAR *Filename) override
FArchive * CreateFileWriter(const TCHAR *Filename, uint32 WriteFlags=0) override
FString ConvertToAbsolutePathForExternalAppForRead(const TCHAR *Filename) override
virtual FFileStatData GetStatData(const TCHAR *FilenameOrDirectory) override
uint32 CopyWithProgress(const TCHAR *InDestFile, const TCHAR *InSrcFile, bool ReplaceExisting, bool EvenIfReadOnly, bool Attributes, FCopyProgress *Progress, EFileRead ReadFlags, EFileWrite WriteFlags)