UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IPlatformFileCachedWrapper.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
7#include "HAL/UnrealMemory.h"
12#include "Misc/Parse.h"
13#include "Logging/LogMacros.h"
14#include "Misc/DateTime.h"
17#include "Templates/UniquePtr.h"
19
21
23{
24public:
26 : FileHandle(InFileHandle)
27 , FilePos(InFileHandle->Tell())
28 , TellPos(FilePos)
29 , FileSize(InFileHandle->Size())
30 , bWritable(bInWritable)
31 , bReadable(bInReadable)
32 , CurrentCache(0)
33 {
34 FlushCache();
35 }
36
38 {
39 }
40
41
42 virtual int64 Tell() override
43 {
44 return FilePos;
45 }
46
47 virtual bool Seek(int64 NewPosition) override
48 {
50 {
51 return false;
52 }
53 FilePos=NewPosition;
54 return true;
55 }
56
57 virtual bool SeekFromEnd(int64 NewPositionRelativeToEnd = 0) override
58 {
59 return Seek(FileSize - NewPositionRelativeToEnd);
60 }
61
62 virtual bool Read(uint8* Destination, int64 BytesToRead) override
63 {
64 if (!bReadable || BytesToRead < 0 || (BytesToRead + FilePos > FileSize))
65 {
66 return false;
67 }
68
69 if (BytesToRead == 0)
70 {
71 return true;
72 }
73
74 bool Result = false;
75 if (BytesToRead > BufferCacheSize) // reading more than we cache
76 {
77 // if the file position is within the cache, copy out the remainder of the cache
78 int32 CacheIndex=GetCacheIndex(FilePos);
79 if (CacheIndex < CacheCount)
80 {
81 int64 CopyBytes = CacheEnd[CacheIndex]-FilePos;
82 FMemory::Memcpy(Destination, BufferCache[CacheIndex]+(FilePos-CacheStart[CacheIndex]), CopyBytes);
83 FilePos += CopyBytes;
84 BytesToRead -= CopyBytes;
85 Destination += CopyBytes;
86 }
87
88 if (InnerSeek(FilePos))
89 {
90 Result = InnerRead(Destination, BytesToRead);
91 }
92 if (Result)
93 {
94 FilePos += BytesToRead;
95 }
96 }
97 else
98 {
99 Result = true;
100
101 while (BytesToRead && Result)
102 {
103 uint32 CacheIndex=GetCacheIndex(FilePos);
104 if (CacheIndex > CacheCount)
105 {
106 // need to update the cache
107 uint64 AlignedFilePos=FilePos&BufferSizeMask; // Aligned Version
108 uint64 SizeToRead=FMath::Min<uint64>(BufferCacheSize, FileSize-AlignedFilePos);
109 InnerSeek(AlignedFilePos);
110 Result = InnerRead(BufferCache[CurrentCache], SizeToRead);
111
112 if (Result)
113 {
114 CacheStart[CurrentCache] = AlignedFilePos;
115 CacheEnd[CurrentCache] = AlignedFilePos+SizeToRead;
116 CacheIndex = CurrentCache;
117 // move to next cache for update
118 CurrentCache++;
119 CurrentCache%=CacheCount;
120 }
121 }
122
123 // copy from the cache to the destination
124 if (Result)
125 {
126 // Analyzer doesn't see this - if this code ever changes make sure there are no buffer overruns!
127 CA_ASSUME(CacheIndex < CacheCount);
128 uint64 CorrectedBytesToRead=FMath::Min<uint64>(BytesToRead, CacheEnd[CacheIndex]-FilePos);
129 FMemory::Memcpy(Destination, BufferCache[CacheIndex]+(FilePos-CacheStart[CacheIndex]), CorrectedBytesToRead);
130 FilePos += CorrectedBytesToRead;
131 Destination += CorrectedBytesToRead;
132 BytesToRead -= CorrectedBytesToRead;
133 }
134 }
135 }
136 return Result;
137 }
138
139 virtual bool ReadAt(uint8* Destination, int64 BytesToRead, int64 Offset) override
140 {
141 // concurrent reads won't be cached yet
142 return FileHandle->ReadAt(Destination, BytesToRead, Offset);
143 }
144
145 virtual bool Write(const uint8* Source, int64 BytesToWrite) override
146 {
147 if (!bWritable || BytesToWrite < 0)
148 {
149 return false;
150 }
151
152 if (BytesToWrite == 0)
153 {
154 return true;
155 }
156
157 InnerSeek(FilePos);
158 bool Result = FileHandle->Write(Source, BytesToWrite);
159 if (Result)
160 {
161 FilePos += BytesToWrite;
162 FileSize = FMath::Max<int64>(FilePos, FileSize);
163 FlushCache();
164 TellPos = FilePos;
165 }
166 return Result;
167 }
168
169 virtual int64 Size() override
170 {
171 return FileSize;
172 }
173
174 virtual bool Flush(const bool bFullFlush = false) override
175 {
176 if (bWritable)
177 {
178 return FileHandle->Flush(bFullFlush);
179 }
180 return false;
181 }
182
183 virtual bool Truncate(int64 NewSize) override
184 {
185 if (bWritable)
186 {
187 if (FileHandle->Truncate(NewSize))
188 {
189 FlushCache();
190 FilePos = TellPos = FileHandle->Tell();
191 FileSize = FileHandle->Size();
192 return true;
193 }
194 }
195 return false;
196 }
197
198 virtual void ShrinkBuffers() override
199 {
200 FileHandle->ShrinkBuffers();
201 }
202
203private:
204
205 static constexpr uint32 BufferCacheSize = 64 * 1024; // Seems to be the magic number for best perf
206 static constexpr uint64 BufferSizeMask = ~((uint64)BufferCacheSize-1);
207 static constexpr uint32 CacheCount = 2;
208
209 bool InnerSeek(uint64 Pos)
210 {
211 if (Pos==TellPos)
212 {
213 return true;
214 }
215 bool bOk=FileHandle->Seek(Pos);
216 if (bOk)
217 {
218 TellPos=Pos;
219 }
220 return bOk;
221 }
222 bool InnerRead(uint8* Dest, uint64 BytesToRead)
223 {
224 if (FileHandle->Read(Dest, BytesToRead))
225 {
226 TellPos += BytesToRead;
227 return true;
228 }
229 return false;
230 }
231 int32 GetCacheIndex(int64 Pos) const
232 {
233 for (uint32 i=0; i<UE_ARRAY_COUNT(CacheStart); ++i)
234 {
235 if (Pos >= CacheStart[i] && Pos < CacheEnd[i])
236 {
237 return i;
238 }
239 }
240 return CacheCount+1;
241 }
242 void FlushCache()
243 {
244 for (uint32 i=0; i<CacheCount; ++i)
245 {
246 CacheStart[i] = CacheEnd[i] = -1;
247 }
248 }
249
250 TUniquePtr<IFileHandle> FileHandle;
251 int64 FilePos; /* Desired position in the file stream, this can be different to FilePos due to the cache */
252 int64 TellPos; /* Actual position in the file, this can be different to FilePos */
253 int64 FileSize;
254 bool bWritable;
255 bool bReadable;
256 uint8 BufferCache[CacheCount][BufferCacheSize];
257 int64 CacheStart[CacheCount];
258 int64 CacheEnd[CacheCount];
259 int32 CurrentCache;
260};
261
263{
264 IPlatformFile* LowerLevel;
265public:
266 static const TCHAR* GetTypeName()
267 {
268 return TEXT("CachedReadFile");
269 }
270
272 : LowerLevel(nullptr)
273 {
274 }
275
276 //~ For visibility of overloads we don't override
281
282 virtual bool Initialize(IPlatformFile* Inner, const TCHAR* CommandLineParam) override
283 {
284 // Inner is required.
285 check(Inner != nullptr);
286 LowerLevel = Inner;
287 return !!LowerLevel;
288 }
289 virtual bool ShouldBeUsed(IPlatformFile* Inner, const TCHAR* CmdLine) const override
290 {
291#ifndef PLATFORM_PROVIDES_FILE_CACHE
292#define PLATFORM_PROVIDES_FILE_CACHE 0
293#endif
294 // Default to false on platforms that already do platform file level caching
297 bool bResult = !bPlatformProvidesFileCache && !bPlatformWindows && FPlatformProperties::RequiresCookedData();
298
299 // Allow a choice between shorter load times or less memory on desktop platforms.
300 // Note: this cannot be in config since they aren't read at that point.
301#if (PLATFORM_DESKTOP || PLATFORM_PROVIDES_FILE_CACHE)
302 {
303 if (FParse::Param(CmdLine, TEXT("NoCachedReadFile")))
304 {
305 bResult = false;
306 }
307 else if (FParse::Param(CmdLine, TEXT("CachedReadFile")))
308 {
309 bResult = true;
310 }
311
312 UE_LOG(LogPlatformFile, Verbose, TEXT("%s cached read wrapper"), bResult ? TEXT("Using") : TEXT("Not using"));
313 }
314#endif
315 return bResult;
316 }
318 {
319 return LowerLevel;
320 }
322 {
323 LowerLevel = NewLowerLevel;
324 }
325 virtual const TCHAR* GetName() const override
326 {
328 }
329 virtual bool FileExists(const TCHAR* Filename) override
330 {
331 return LowerLevel->FileExists(Filename);
332 }
333 virtual int64 FileSize(const TCHAR* Filename) override
334 {
335 return LowerLevel->FileSize(Filename);
336 }
337 virtual bool DeleteFile(const TCHAR* Filename) override
338 {
339 return LowerLevel->DeleteFile(Filename);
340 }
341 virtual bool IsReadOnly(const TCHAR* Filename) override
342 {
343 return LowerLevel->IsReadOnly(Filename);
344 }
345 virtual bool MoveFile(const TCHAR* To, const TCHAR* From) override
346 {
347 return LowerLevel->MoveFile(To, From);
348 }
349 virtual bool SetReadOnly(const TCHAR* Filename, bool bNewReadOnlyValue) override
350 {
351 return LowerLevel->SetReadOnly(Filename, bNewReadOnlyValue);
352 }
353 virtual FDateTime GetTimeStamp(const TCHAR* Filename) override
354 {
355 return LowerLevel->GetTimeStamp(Filename);
356 }
357 virtual void SetTimeStamp(const TCHAR* Filename, FDateTime DateTime) override
358 {
359 LowerLevel->SetTimeStamp(Filename, DateTime);
360 }
361 virtual FDateTime GetAccessTimeStamp(const TCHAR* Filename) override
362 {
363 return LowerLevel->GetAccessTimeStamp(Filename);
364 }
365 virtual FString GetFilenameOnDisk(const TCHAR* Filename) override
366 {
367 return LowerLevel->GetFilenameOnDisk(Filename);
368 }
369 virtual IFileHandle* OpenRead(const TCHAR* Filename, bool bAllowWrite) override
370 {
371 IFileHandle* InnerHandle=LowerLevel->OpenRead(Filename, bAllowWrite);
372 if (!InnerHandle)
373 {
374 return nullptr;
375 }
376 return new FCachedFileHandle(InnerHandle, true, false);
377 }
378 virtual IFileHandle* OpenWrite(const TCHAR* Filename, bool bAppend = false, bool bAllowRead = false) override
379 {
380 IFileHandle* InnerHandle=LowerLevel->OpenWrite(Filename, bAppend, bAllowRead);
381 if (!InnerHandle)
382 {
383 return nullptr;
384 }
385 return new FCachedFileHandle(InnerHandle, bAllowRead, true);
386 }
387 virtual bool DirectoryExists(const TCHAR* Directory) override
388 {
389 return LowerLevel->DirectoryExists(Directory);
390 }
391 virtual bool CreateDirectory(const TCHAR* Directory) override
392 {
393 return LowerLevel->CreateDirectory(Directory);
394 }
395 virtual bool DeleteDirectory(const TCHAR* Directory) override
396 {
397 return LowerLevel->DeleteDirectory(Directory);
398 }
400 {
401 return LowerLevel->GetStatData(FilenameOrDirectory);
402 }
403 virtual bool IterateDirectory(const TCHAR* Directory, IPlatformFile::FDirectoryVisitor& Visitor) override
404 {
405 return LowerLevel->IterateDirectory(Directory, Visitor);
406 }
407 virtual bool IterateDirectoryRecursively(const TCHAR* Directory, IPlatformFile::FDirectoryVisitor& Visitor) override
408 {
409 return LowerLevel->IterateDirectoryRecursively(Directory, Visitor);
410 }
411 virtual bool IterateDirectoryStat(const TCHAR* Directory, IPlatformFile::FDirectoryStatVisitor& Visitor) override
412 {
413 return LowerLevel->IterateDirectoryStat(Directory, Visitor);
414 }
415 virtual bool IterateDirectoryStatRecursively(const TCHAR* Directory, IPlatformFile::FDirectoryStatVisitor& Visitor) override
416 {
417 return LowerLevel->IterateDirectoryStatRecursively(Directory, Visitor);
418 }
419 virtual void FindFiles(TArray<FString>& FoundFiles, const TCHAR* Directory, const TCHAR* FileExtension)
420 {
421 return LowerLevel->FindFiles(FoundFiles, Directory, FileExtension);
422 }
423 virtual void FindFilesRecursively(TArray<FString>& FoundFiles, const TCHAR* Directory, const TCHAR* FileExtension)
424 {
425 return LowerLevel->FindFilesRecursively(FoundFiles, Directory, FileExtension);
426 }
427 virtual bool DeleteDirectoryRecursively(const TCHAR* Directory) override
428 {
429 return LowerLevel->DeleteDirectoryRecursively(Directory);
430 }
432 {
433 return LowerLevel->CopyFile(To, From, ReadFlags, WriteFlags);
434 }
435 virtual bool CreateDirectoryTree(const TCHAR* Directory) override
436 {
437 return LowerLevel->CreateDirectoryTree(Directory);
438 }
439 virtual bool CopyDirectoryTree(const TCHAR* DestinationDirectory, const TCHAR* Source, bool bOverwriteAllExisting) override
440 {
441 return LowerLevel->CopyDirectoryTree(DestinationDirectory, Source, bOverwriteAllExisting);
442 }
443 virtual FString ConvertToAbsolutePathForExternalAppForRead( const TCHAR* Filename ) override
444 {
445 return LowerLevel->ConvertToAbsolutePathForExternalAppForRead(Filename);
446 }
447 virtual FString ConvertToAbsolutePathForExternalAppForWrite( const TCHAR* Filename ) override
448 {
449 return LowerLevel->ConvertToAbsolutePathForExternalAppForWrite(Filename);
450 }
451 virtual bool SendMessageToServer(const TCHAR* Message, IFileServerMessageHandler* Handler) override
452 {
453 return LowerLevel->SendMessageToServer(Message, Handler);
454 }
455 virtual IAsyncReadFileHandle* OpenAsyncRead(const TCHAR* Filename, bool bAllowWrite = false) override
456 {
457 return LowerLevel->OpenAsyncRead(Filename, bAllowWrite);
458 }
459 virtual FOpenMappedResult OpenMappedEx(const TCHAR* Filename, EOpenReadFlags OpenOptions = EOpenReadFlags::None, int64 MaximumSize = 0) override
460 {
461 return LowerLevel->OpenMappedEx(Filename, OpenOptions, MaximumSize);
462 }
463 virtual void SetAsyncMinimumPriority(EAsyncIOPriorityAndFlags MinPriority) override
464 {
465 LowerLevel->SetAsyncMinimumPriority(MinPriority);
466 }
467 virtual bool FileJournalIsAvailable(const TCHAR* VolumeOrPath = nullptr,
468 ELogVerbosity::Type* OutErrorLevel = nullptr, FString* OutError = nullptr) override
469 {
471 }
472 virtual bool FileJournalIterateDirectory(const TCHAR* Directory,
473 FDirectoryJournalVisitorFunc Visitor, FString* OutError = nullptr) override
474 {
475 return LowerLevel->FileJournalIterateDirectory(Directory, Visitor, OutError);
476 }
478 FFileJournalEntryHandle& OutEntryHandle, FString* OutError = nullptr) override
479 {
480 return LowerLevel->FileJournalGetLatestEntry(VolumeName, OutJournalId, OutEntryHandle, OutError);
481 }
491 FString* OutError = nullptr) override
492 {
494 }
496 {
497 return LowerLevel->FileJournalGetVolumeName(InPath);
498 }
500 ELogVerbosity::Type* OutErrorLevel = nullptr, FString* OutError = nullptr) const override
501 {
503 }
504};
#define check(expr)
Definition AssertionMacros.h:314
#define CA_ASSUME(Expr)
Definition CoreMiscDefines.h:126
#define PLATFORM_WINDOWS
Definition Platform.h:12
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint64 FFileJournalEntryHandle
Definition GenericPlatformFile.h:250
EPlatformFileRead
Definition GenericPlatformFile.h:59
uint64 FFileJournalId
Definition GenericPlatformFile.h:244
EFileJournalResult
Definition GenericPlatformFile.h:100
EPlatformFileWrite
Definition GenericPlatformFile.h:70
EAsyncIOPriorityAndFlags
Definition GenericPlatformFile.h:31
#define PLATFORM_PROVIDES_FILE_CACHE
#define UE_LOG(CategoryName, Verbosity, Format,...)
Definition LogMacros.h:270
#define UE_ARRAY_COUNT(array)
Definition UnrealTemplate.h:212
uint32 Offset
Definition VulkanMemory.cpp:4033
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition IPlatformFileCachedWrapper.h:23
virtual bool Write(const uint8 *Source, int64 BytesToWrite) override
Definition IPlatformFileCachedWrapper.h:145
virtual bool SeekFromEnd(int64 NewPositionRelativeToEnd=0) override
Definition IPlatformFileCachedWrapper.h:57
virtual int64 Size() override
Definition IPlatformFileCachedWrapper.h:169
virtual int64 Tell() override
Definition IPlatformFileCachedWrapper.h:42
virtual bool Flush(const bool bFullFlush=false) override
Definition IPlatformFileCachedWrapper.h:174
virtual bool ReadAt(uint8 *Destination, int64 BytesToRead, int64 Offset) override
Definition IPlatformFileCachedWrapper.h:139
virtual void ShrinkBuffers() override
Definition IPlatformFileCachedWrapper.h:198
virtual bool Seek(int64 NewPosition) override
Definition IPlatformFileCachedWrapper.h:47
virtual ~FCachedFileHandle()
Definition IPlatformFileCachedWrapper.h:37
FCachedFileHandle(IFileHandle *InFileHandle, bool bInReadable, bool bInWritable)
Definition IPlatformFileCachedWrapper.h:25
virtual bool Truncate(int64 NewSize) override
Definition IPlatformFileCachedWrapper.h:183
virtual bool Read(uint8 *Destination, int64 BytesToRead) override
Definition IPlatformFileCachedWrapper.h:62
Definition IPlatformFileCachedWrapper.h:263
virtual bool SendMessageToServer(const TCHAR *Message, IFileServerMessageHandler *Handler) override
Definition IPlatformFileCachedWrapper.h:451
IPlatformFile * GetLowerLevel() override
Definition IPlatformFileCachedWrapper.h:317
virtual EFileJournalResult FileJournalGetLatestEntry(const TCHAR *VolumeName, FFileJournalId &OutJournalId, FFileJournalEntryHandle &OutEntryHandle, FString *OutError=nullptr) override
Definition IPlatformFileCachedWrapper.h:477
virtual bool CopyFile(const TCHAR *To, const TCHAR *From, EPlatformFileRead ReadFlags=EPlatformFileRead::None, EPlatformFileWrite WriteFlags=EPlatformFileWrite::None) override
Definition IPlatformFileCachedWrapper.h:431
virtual bool FileExists(const TCHAR *Filename) override
Definition IPlatformFileCachedWrapper.h:329
virtual FString ConvertToAbsolutePathForExternalAppForRead(const TCHAR *Filename) override
Definition IPlatformFileCachedWrapper.h:443
virtual bool Initialize(IPlatformFile *Inner, const TCHAR *CommandLineParam) override
Definition IPlatformFileCachedWrapper.h:282
virtual IFileHandle * OpenWrite(const TCHAR *Filename, bool bAppend=false, bool bAllowRead=false) override
Definition IPlatformFileCachedWrapper.h:378
virtual FString GetFilenameOnDisk(const TCHAR *Filename) override
Definition IPlatformFileCachedWrapper.h:365
virtual FDateTime GetAccessTimeStamp(const TCHAR *Filename) override
Definition IPlatformFileCachedWrapper.h:361
virtual bool DeleteFile(const TCHAR *Filename) override
Definition IPlatformFileCachedWrapper.h:337
virtual void SetTimeStamp(const TCHAR *Filename, FDateTime DateTime) override
Definition IPlatformFileCachedWrapper.h:357
FCachedReadPlatformFile()
Definition IPlatformFileCachedWrapper.h:271
virtual bool SetReadOnly(const TCHAR *Filename, bool bNewReadOnlyValue) override
Definition IPlatformFileCachedWrapper.h:349
virtual uint64 FileJournalGetMaximumSize(const TCHAR *VolumeOrPath=nullptr, ELogVerbosity::Type *OutErrorLevel=nullptr, FString *OutError=nullptr) const override
Definition IPlatformFileCachedWrapper.h:499
virtual bool FileJournalIterateDirectory(const TCHAR *Directory, FDirectoryJournalVisitorFunc Visitor, FString *OutError=nullptr) override
Definition IPlatformFileCachedWrapper.h:472
virtual FOpenMappedResult OpenMappedEx(const TCHAR *Filename, EOpenReadFlags OpenOptions=EOpenReadFlags::None, int64 MaximumSize=0) override
Definition IPlatformFileCachedWrapper.h:459
virtual FFileJournalData FileJournalGetFileData(const TCHAR *FilenameOrDirectory, FString *OutError=nullptr) override
Definition IPlatformFileCachedWrapper.h:490
virtual bool CreateDirectory(const TCHAR *Directory) override
Definition IPlatformFileCachedWrapper.h:391
virtual FDateTime GetTimeStamp(const TCHAR *Filename) override
Definition IPlatformFileCachedWrapper.h:353
virtual bool IterateDirectoryStatRecursively(const TCHAR *Directory, IPlatformFile::FDirectoryStatVisitor &Visitor) override
Definition IPlatformFileCachedWrapper.h:415
virtual bool ShouldBeUsed(IPlatformFile *Inner, const TCHAR *CmdLine) const override
Definition IPlatformFileCachedWrapper.h:289
virtual bool DeleteDirectoryRecursively(const TCHAR *Directory) override
Definition IPlatformFileCachedWrapper.h:427
virtual void SetAsyncMinimumPriority(EAsyncIOPriorityAndFlags MinPriority) override
Definition IPlatformFileCachedWrapper.h:463
virtual FString FileJournalGetVolumeName(FStringView InPath) override
Definition IPlatformFileCachedWrapper.h:495
virtual FFileStatData GetStatData(const TCHAR *FilenameOrDirectory) override
Definition IPlatformFileCachedWrapper.h:399
virtual void FindFiles(TArray< FString > &FoundFiles, const TCHAR *Directory, const TCHAR *FileExtension)
Definition IPlatformFileCachedWrapper.h:419
virtual bool DeleteDirectory(const TCHAR *Directory) override
Definition IPlatformFileCachedWrapper.h:395
virtual bool FileJournalIsAvailable(const TCHAR *VolumeOrPath=nullptr, ELogVerbosity::Type *OutErrorLevel=nullptr, FString *OutError=nullptr) override
Definition IPlatformFileCachedWrapper.h:467
virtual EFileJournalResult FileJournalReadModified(const TCHAR *VolumeName, const FFileJournalId &JournalIdOfStartingEntry, const FFileJournalEntryHandle &StartingJournalEntry, TMap< FFileJournalFileHandle, FString > &KnownDirectories, TSet< FString > &OutModifiedDirectories, FFileJournalEntryHandle &OutNextJournalEntry, FString *OutError=nullptr) override
Definition IPlatformFileCachedWrapper.h:482
virtual IAsyncReadFileHandle * OpenAsyncRead(const TCHAR *Filename, bool bAllowWrite=false) override
Definition IPlatformFileCachedWrapper.h:455
virtual bool IterateDirectoryRecursively(const TCHAR *Directory, IPlatformFile::FDirectoryVisitor &Visitor) override
Definition IPlatformFileCachedWrapper.h:407
virtual bool IterateDirectory(const TCHAR *Directory, IPlatformFile::FDirectoryVisitor &Visitor) override
Definition IPlatformFileCachedWrapper.h:403
virtual bool DirectoryExists(const TCHAR *Directory) override
Definition IPlatformFileCachedWrapper.h:387
virtual const TCHAR * GetName() const override
Definition IPlatformFileCachedWrapper.h:325
virtual bool MoveFile(const TCHAR *To, const TCHAR *From) override
Definition IPlatformFileCachedWrapper.h:345
static const TCHAR * GetTypeName()
Definition IPlatformFileCachedWrapper.h:266
virtual IFileHandle * OpenRead(const TCHAR *Filename, bool bAllowWrite) override
Definition IPlatformFileCachedWrapper.h:369
virtual bool IsReadOnly(const TCHAR *Filename) override
Definition IPlatformFileCachedWrapper.h:341
virtual FString ConvertToAbsolutePathForExternalAppForWrite(const TCHAR *Filename) override
Definition IPlatformFileCachedWrapper.h:447
virtual void SetLowerLevel(IPlatformFile *NewLowerLevel) override
Definition IPlatformFileCachedWrapper.h:321
virtual void FindFilesRecursively(TArray< FString > &FoundFiles, const TCHAR *Directory, const TCHAR *FileExtension)
Definition IPlatformFileCachedWrapper.h:423
virtual int64 FileSize(const TCHAR *Filename) override
Definition IPlatformFileCachedWrapper.h:333
virtual bool CopyDirectoryTree(const TCHAR *DestinationDirectory, const TCHAR *Source, bool bOverwriteAllExisting) override
Definition IPlatformFileCachedWrapper.h:439
virtual bool IterateDirectoryStat(const TCHAR *Directory, IPlatformFile::FDirectoryStatVisitor &Visitor) override
Definition IPlatformFileCachedWrapper.h:411
virtual bool CreateDirectoryTree(const TCHAR *Directory) override
Definition IPlatformFileCachedWrapper.h:435
Definition AsyncFileHandle.h:211
Definition GenericPlatformFile.h:117
virtual bool ReadAt(uint8 *Destination, int64 BytesToRead, int64 Offset)=0
virtual void ShrinkBuffers()
Definition GenericPlatformFile.h:179
virtual bool Flush(const bool bFullFlush=false)=0
virtual bool Seek(int64 NewPosition)=0
virtual bool Read(uint8 *Destination, int64 BytesToRead)=0
virtual int64 Tell()=0
virtual bool Truncate(int64 NewSize)=0
virtual bool Write(const uint8 *Source, int64 BytesToWrite)=0
virtual CORE_API int64 Size()
Definition GenericPlatformFile.cpp:578
Definition GenericPlatformFile.h:623
Definition GenericPlatformFile.h:576
Definition GenericPlatformFile.h:925
Definition GenericPlatformFile.h:342
virtual CORE_API EFileJournalResult FileJournalReadModified(const TCHAR *VolumeName, const FFileJournalId &JournalIdOfStartingEntry, const FFileJournalEntryHandle &StartingJournalEntry, TMap< FFileJournalFileHandle, FString > &KnownDirectories, TSet< FString > &OutModifiedDirectories, FFileJournalEntryHandle &OutNextJournalEntry, FString *OutError=nullptr)
Definition GenericPlatformFile.cpp:1138
virtual CORE_API bool IterateDirectoryRecursively(const TCHAR *Directory, FDirectoryVisitor &Visitor)
Definition GenericPlatformFile.cpp:677
virtual CORE_API FString FileJournalGetVolumeName(FStringView InPath)
Definition GenericPlatformFile.cpp:1151
virtual CORE_API FString ConvertToAbsolutePathForExternalAppForWrite(const TCHAR *Filename)
Definition GenericPlatformFile.cpp:998
virtual CORE_API uint64 FileJournalGetMaximumSize(const TCHAR *VolumeOrPath=nullptr, ELogVerbosity::Type *OutErrorLevel=nullptr, FString *OutError=nullptr) const
Definition GenericPlatformFile.cpp:1098
virtual CORE_API bool CopyFile(const TCHAR *To, const TCHAR *From, EPlatformFileRead ReadFlags=EPlatformFileRead::None, EPlatformFileWrite WriteFlags=EPlatformFileWrite::None)
Definition GenericPlatformFile.cpp:870
virtual CORE_API FFileOpenResult OpenRead(const TCHAR *Filename, EOpenReadFlags Flags)
Definition GenericPlatformFile.cpp:497
virtual IFileHandle * OpenWrite(const TCHAR *Filename, bool bAppend=false, bool bAllowRead=false)=0
virtual FFileStatData GetStatData(const TCHAR *FilenameOrDirectory)=0
virtual CORE_API FFileOpenAsyncResult OpenAsyncRead(const TCHAR *Filename, EOpenReadFlags Flags)
Definition GenericPlatformFile.cpp:517
virtual bool IterateDirectoryStat(const TCHAR *Directory, FDirectoryStatVisitor &Visitor)=0
virtual bool MoveFile(const TCHAR *To, const TCHAR *From)=0
virtual CORE_API bool DeleteDirectoryRecursively(const TCHAR *Directory)
Definition GenericPlatformFile.cpp:822
virtual void SetAsyncMinimumPriority(EAsyncIOPriorityAndFlags MinPriority)
Definition GenericPlatformFile.h:779
virtual bool IterateDirectory(const TCHAR *Directory, FDirectoryVisitor &Visitor)=0
virtual bool IsReadOnly(const TCHAR *Filename)=0
virtual bool DeleteDirectory(const TCHAR *Directory)=0
virtual void SetTimeStamp(const TCHAR *Filename, FDateTime DateTime)=0
virtual bool DirectoryExists(const TCHAR *Directory)=0
virtual bool DeleteFile(const TCHAR *Filename)=0
virtual CORE_API FFileJournalData FileJournalGetFileData(const TCHAR *FilenameOrDirectory, FString *OutError=nullptr)
Definition GenericPlatformFile.cpp:1133
virtual bool SetReadOnly(const TCHAR *Filename, bool bNewReadOnlyValue)=0
virtual CORE_API EFileJournalResult FileJournalGetLatestEntry(const TCHAR *VolumeName, FFileJournalId &OutJournalId, FFileJournalEntryHandle &OutEntryHandle, FString *OutError=nullptr)
Definition GenericPlatformFile.cpp:1112
virtual CORE_API bool FileJournalIterateDirectory(const TCHAR *Directory, FDirectoryJournalVisitorFunc Visitor, FString *OutError=nullptr)
Definition GenericPlatformFile.cpp:1124
virtual CORE_API void FindFiles(TArray< FString > &FoundFiles, const TCHAR *Directory, const TCHAR *FileExtension)
Definition GenericPlatformFile.cpp:810
virtual bool FileExists(const TCHAR *Filename)=0
virtual int64 FileSize(const TCHAR *Filename)=0
virtual CORE_API bool FileJournalIsAvailable(const TCHAR *VolumeOrPath=nullptr, ELogVerbosity::Type *OutErrorLevel=nullptr, FString *OutError=nullptr)
Definition GenericPlatformFile.cpp:1084
virtual CORE_API bool CreateDirectoryTree(const TCHAR *Directory)
Definition GenericPlatformFile.cpp:1033
virtual CORE_API void FindFilesRecursively(TArray< FString > &FoundFiles, const TCHAR *Directory, const TCHAR *FileExtension)
Definition GenericPlatformFile.cpp:816
virtual bool SendMessageToServer(const TCHAR *Message, IFileServerMessageHandler *Handler)
Definition GenericPlatformFile.h:944
virtual bool CreateDirectory(const TCHAR *Directory)=0
EOpenReadFlags
Definition GenericPlatformFile.h:496
virtual CORE_API FString ConvertToAbsolutePathForExternalAppForRead(const TCHAR *Filename)
Definition GenericPlatformFile.cpp:993
virtual FString GetFilenameOnDisk(const TCHAR *Filename)=0
virtual CORE_API FOpenMappedResult OpenMappedEx(const TCHAR *Filename, EOpenReadFlags OpenOptions=EOpenReadFlags::None, int64 MaximumSize=0)
Definition GenericPlatformFile.cpp:551
virtual CORE_API bool IterateDirectoryStatRecursively(const TCHAR *Directory, FDirectoryStatVisitor &Visitor)
Definition GenericPlatformFile.cpp:734
virtual FDateTime GetTimeStamp(const TCHAR *Filename)=0
virtual FDateTime GetAccessTimeStamp(const TCHAR *Filename)=0
virtual CORE_API bool CopyDirectoryTree(const TCHAR *DestinationDirectory, const TCHAR *Source, bool bOverwriteAllExisting)
Definition GenericPlatformFile.cpp:913
Definition Array.h:670
Definition AssetRegistryState.h:50
Definition UnrealString.h.inl:34
Definition UniquePtr.h:107
Definition ValueOrError.h:58
Type
Definition LogVerbosity.h:17
Definition DateTime.h:76
Definition GenericPlatformFile.h:271
Definition GenericPlatformFile.h:195
static UE_FORCEINLINE_HINT void * Memcpy(void *Dest, const void *Src, SIZE_T Count)
Definition UnrealMemory.h:160
static CORE_API bool Param(const TCHAR *Stream, const TCHAR *Param)
Definition Parse.cpp:325