UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FPakPlatformFile Class Reference

#include <IPlatformFilePak.h>

+ Inheritance diagram for FPakPlatformFile:

Classes

struct  FPakSigningFailureHandlerData
 

Public Member Functions

PAKFILE_API EChunkLocation::Type GetPakChunkLocation (int32 InPakchunkIndex) const
 
PAKFILE_API bool AnyChunksAvailable () const
 
void GetMountedPakFilenames (TArray< FString > &PakFilenames)
 
void GetMountedPakFilenames (TSet< FString > &PakFilenames)
 
void GetMountedChunkIds (TSet< int32 > &OutChunkIds)
 
PAKFILE_API FPakPlatformFile ()
 
virtual PAKFILE_API ~FPakPlatformFile ()
 
virtual PAKFILE_API bool ShouldBeUsed (IPlatformFile *Inner, const TCHAR *CmdLine) const override
 
virtual PAKFILE_API bool Initialize (IPlatformFile *Inner, const TCHAR *CommandLineParam) override
 
virtual PAKFILE_API void InitializeNewAsyncIO () override
 
PAKFILE_API void OptimizeMemoryUsageForMountedPaks ()
 
virtual IPlatformFileGetLowerLevel () override
 
virtual void SetLowerLevel (IPlatformFile *NewLowerLevel) override
 
virtual const TCHARGetName () const override
 
PAKFILE_API void Tick () override
 
PAKFILE_API bool Mount (const TCHAR *InPakFilename, uint32 PakOrder, const TCHAR *InPath=nullptr, bool bLoadIndex=true, FPakListEntry *OutPakListEntry=nullptr)
 
PAKFILE_API bool Mount (const FPakMountArgs &MountArgs, FIoStatus *OutIoMountStatus=nullptr, FPakListEntry *OutPakListEntry=nullptr)
 
PAKFILE_API bool Unmount (const TCHAR *InPakFilename)
 
PAKFILE_API int32 MountAllPakFiles (const TArray< FString > &PakFolders)
 
PAKFILE_API int32 MountAllPakFiles (const TArray< FString > &PakFolders, const FString &WildCard)
 
PAKFILE_API bool ReloadPakReaders ()
 
virtual PAKFILE_API void MakeUniquePakFilesForTheseFiles (const TArray< TArray< FString > > &InFiles)
 
PAKFILE_API bool FindFileInPakFiles (const TCHAR *Filename, TRefCountPtr< FPakFile > *OutPakFile=nullptr, FPakEntry *OutEntry=nullptr)
 
virtual bool FileExists (const TCHAR *Filename) override
 
virtual int64 FileSize (const TCHAR *Filename) override
 
virtual bool DeleteFile (const TCHAR *Filename) override
 
virtual bool IsReadOnly (const TCHAR *Filename) override
 
virtual bool MoveFile (const TCHAR *To, const TCHAR *From) override
 
virtual bool SetReadOnly (const TCHAR *Filename, bool bNewReadOnlyValue) override
 
virtual FDateTime GetTimeStamp (const TCHAR *Filename) override
 
virtual void GetTimeStampPair (const TCHAR *FilenameA, const TCHAR *FilenameB, FDateTime &OutTimeStampA, FDateTime &OutTimeStampB) override
 
virtual void SetTimeStamp (const TCHAR *Filename, FDateTime DateTime) override
 
virtual FDateTime GetAccessTimeStamp (const TCHAR *Filename) override
 
virtual FString GetFilenameOnDisk (const TCHAR *Filename) override
 
virtual ESymlinkResult IsSymlink (const TCHAR *Filename) override
 
virtual PAKFILE_API IFileHandleOpenRead (const TCHAR *Filename, bool bAllowWrite=false) override
 
virtual PAKFILE_API IFileHandleOpenWrite (const TCHAR *Filename, bool bAppend=false, bool bAllowRead=false) override
 
virtual PAKFILE_API bool DirectoryExists (const TCHAR *Directory) override
 
virtual PAKFILE_API bool CreateDirectory (const TCHAR *Directory) override
 
virtual PAKFILE_API bool DeleteDirectory (const TCHAR *Directory) override
 
virtual PAKFILE_API FFileStatData GetStatData (const TCHAR *FilenameOrDirectory) override
 
virtual PAKFILE_API bool IterateDirectory (const TCHAR *Directory, IPlatformFile::FDirectoryVisitor &Visitor) override
 
virtual PAKFILE_API bool IterateDirectoryRecursively (const TCHAR *Directory, IPlatformFile::FDirectoryVisitor &Visitor) override
 
virtual PAKFILE_API bool IterateDirectoryStat (const TCHAR *Directory, IPlatformFile::FDirectoryStatVisitor &Visitor) override
 
virtual PAKFILE_API bool IterateDirectoryStatRecursively (const TCHAR *Directory, IPlatformFile::FDirectoryStatVisitor &Visitor) override
 
virtual PAKFILE_API void FindFiles (TArray< FString > &FoundFiles, const TCHAR *Directory, const TCHAR *FileExtension) override
 
virtual PAKFILE_API void FindFilesRecursively (TArray< FString > &FoundFiles, const TCHAR *Directory, const TCHAR *FileExtension) override
 
virtual PAKFILE_API bool DeleteDirectoryRecursively (const TCHAR *Directory) override
 
virtual PAKFILE_API bool CreateDirectoryTree (const TCHAR *Directory) override
 
virtual PAKFILE_API bool CopyFile (const TCHAR *To, const TCHAR *From, EPlatformFileRead ReadFlags=EPlatformFileRead::None, EPlatformFileWrite WriteFlags=EPlatformFileWrite::None) override
 
virtual PAKFILE_API IAsyncReadFileHandleOpenAsyncRead (const TCHAR *Filename, bool bAllowWrite=false) override
 
virtual PAKFILE_API void SetAsyncMinimumPriority (EAsyncIOPriorityAndFlags Priority) override
 
virtual FOpenMappedResult OpenMappedEx (const TCHAR *Filename, EOpenReadFlags OpenOptions=EOpenReadFlags::None, int64 MaximumSize=0) override
 
FString ConvertToPakRelativePath (const TCHAR *Filename, const FPakFile *Pak)
 
FString ConvertToAbsolutePathForExternalAppForRead (const TCHAR *Filename) override
 
FString ConvertToAbsolutePathForExternalAppForWrite (const TCHAR *Filename) override
 
PAKFILE_API void RefreshPakChunkIndicies ()
 
PAKFILE_API void GetPrunedFilenamesInChunk (const FString &InPakFilename, const TArray< int32 > &InChunkIDs, TArray< FString > &OutFileList)
 
PAKFILE_API void GetPrunedFilenamesInPakFile (const FString &InPakFilename, TArray< FString > &OutFileList)
 
PAKFILE_API void ReleaseOldReaders ()
 
PAKFILE_API void HandlePakListCommand (const TCHAR *Cmd, FOutputDevice &Ar)
 
PAKFILE_API void HandleMountCommand (const TCHAR *Cmd, FOutputDevice &Ar)
 
PAKFILE_API void HandleUnmountCommand (const TCHAR *Cmd, FOutputDevice &Ar)
 
PAKFILE_API void HandlePakCorruptCommand (const TCHAR *Cmd, FOutputDevice &Ar)
 
PAKFILE_API void HandleReloadPakReadersCommand (const TCHAR *Cmd, FOutputDevice &Ar)
 
virtual bool IterateDirectory (const TCHAR *Directory, FDirectoryVisitor &Visitor)=0
 
virtual CORE_API bool IterateDirectory (const TCHAR *Directory, FDirectoryVisitorFunc Visitor)
 
virtual CORE_API bool IterateDirectoryRecursively (const TCHAR *Directory, FDirectoryVisitor &Visitor)
 
virtual CORE_API bool IterateDirectoryRecursively (const TCHAR *Directory, FDirectoryVisitorFunc Visitor)
 
virtual bool IterateDirectoryStat (const TCHAR *Directory, FDirectoryStatVisitor &Visitor)=0
 
virtual CORE_API bool IterateDirectoryStat (const TCHAR *Directory, FDirectoryStatVisitorFunc Visitor)
 
virtual CORE_API bool IterateDirectoryStatRecursively (const TCHAR *Directory, FDirectoryStatVisitor &Visitor)
 
virtual CORE_API bool IterateDirectoryStatRecursively (const TCHAR *Directory, FDirectoryStatVisitorFunc Visitor)
 
- Public Member Functions inherited from IPlatformFile
CORE_API IPlatformFile ()
 
virtual CORE_API ~IPlatformFile ()
 
virtual void SetSandboxEnabled (bool bInEnabled)
 
virtual bool IsSandboxEnabled () const
 
virtual void InitializeAfterSetActive ()
 
virtual void InitializeAfterProjectFilePath ()
 
virtual void AddLocalDirectories (TArray< FString > &LocalDirectories)
 
virtual void BypassSecurity (bool bInBypass)
 
virtual bool DeleteFiles (const TArrayView< const TCHAR * > &Filenames)
 
virtual bool HasMarkOfTheWeb (FStringView Filename, FString *OutSourceURL=nullptr)
 
virtual bool SetMarkOfTheWeb (FStringView Filename, bool bNewStatus, const FString *InSourceURL=nullptr)
 
virtual CORE_API FFileOpenResult OpenRead (const TCHAR *Filename, EOpenReadFlags Flags)
 
virtual FFileOpenResult OpenReadNoBuffering (const TCHAR *Filename, EOpenReadFlags Flags)
 
virtual IFileHandleOpenReadNoBuffering (const TCHAR *Filename, bool bAllowWrite=false)
 
virtual CORE_API FFileOpenResult OpenWrite (const TCHAR *Filename, EOpenWriteFlags Flags)
 
virtual CORE_API bool FileJournalIsAvailable (const TCHAR *VolumeOrPath=nullptr, ELogVerbosity::Type *OutErrorLevel=nullptr, FString *OutError=nullptr)
 
virtual CORE_API uint64 FileJournalGetMaximumSize (const TCHAR *VolumeOrPath=nullptr, ELogVerbosity::Type *OutErrorLevel=nullptr, FString *OutError=nullptr) const
 
virtual CORE_API EFileJournalResult FileJournalGetLatestEntry (const TCHAR *VolumeName, FFileJournalId &OutJournalId, FFileJournalEntryHandle &OutEntryHandle, FString *OutError=nullptr)
 
virtual CORE_API bool FileJournalIterateDirectory (const TCHAR *Directory, FDirectoryJournalVisitorFunc Visitor, FString *OutError=nullptr)
 
virtual CORE_API FFileJournalData FileJournalGetFileData (const TCHAR *FilenameOrDirectory, FString *OutError=nullptr)
 
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)
 
virtual CORE_API FString FileJournalGetVolumeName (FStringView InPath)
 
virtual CORE_API FFileOpenAsyncResult OpenAsyncRead (const TCHAR *Filename, EOpenReadFlags Flags)
 
virtual CORE_API IMappedFileHandleOpenMapped (const TCHAR *Filename)
 
virtual CORE_API FDateTime GetTimeStampLocal (const TCHAR *Filename)
 
virtual CORE_API bool CopyDirectoryTree (const TCHAR *DestinationDirectory, const TCHAR *Source, bool bOverwriteAllExisting)
 
virtual bool SendMessageToServer (const TCHAR *Message, IFileServerMessageHandler *Handler)
 
virtual bool DoesCreatePublicFiles ()
 
virtual void SetCreatePublicFiles (bool bCreatePublicFiles)
 
virtual int64 GetAllowedBytesToWriteThrottledStorage (const TCHAR *DestinationPath=nullptr)
 

Static Public Member Functions

static const TCHARGetTypeName ()
 
static PAKFILE_API const TCHARGetMountStartupPaksWildCard ()
 
static PAKFILE_API void SetMountStartupPaksWildCard (const FString &WildCard)
 
static PAKFILE_API bool CheckIfPakFilesExist (IPlatformFile *LowLevelFile, const TArray< FString > &PakFolders)
 
static PAKFILE_API void GetPakFolders (const TCHAR *CmdLine, TArray< FString > &OutPakFolders)
 
static PAKFILE_API void GetPakEncryptionKey (FAES::FAESKey &OutKey, const FGuid &InEncryptionKeyGuid)
 
static PAKFILE_API TSharedPtr< const struct FPakSignatureFile, ESPMode::ThreadSafeGetPakSignatureFile (const TCHAR *InFilename)
 
static PAKFILE_API void RemoveCachedPakSignaturesFile (const TCHAR *InFilename)
 
static PAKFILE_API bool FindFileInPakFiles (TArray< FPakListEntry > &Paks, const TCHAR *Filename, TRefCountPtr< FPakFile > *OutPakFile, FPakEntry *OutEntry=nullptr)
 
static PAKFILE_API FFilenameSecurityDelegateGetFilenameSecurityDelegate ()
 
static PAKFILE_API FPakCustomEncryptionDelegateGetPakCustomEncryptionDelegate ()
 
static PAKFILE_API FPakSigningFailureHandlerDataGetPakSigningFailureHandlerData ()
 
static PAKFILE_API void BroadcastPakChunkSignatureCheckFailure (const FPakChunkSignatureCheckFailedData &InData)
 
static PAKFILE_API void BroadcastPakPrincipalSignatureTableCheckFailure (const FString &InFilename)
 
static PAKFILE_API void BroadcastPakMasterSignatureTableCheckFailure (const FString &InFilename)
 
static PAKFILE_API FPakSetIndexSettingsGetPakSetIndexSettingsDelegate ()
 
static PAKFILE_API void GetFilenamesFromIostoreContainer (const FString &InContainerName, TArray< FString > &OutFileList)
 
static PAKFILE_API void GetFilenamesFromIostoreByBlockIndex (const FString &InContainerName, const TArray< int32 > &InBlockIndex, TArray< FString > &OutFileList)
 
static PAKFILE_API void ForeachPackageInIostoreWhile (TFunctionRef< bool(FName)> Predicate)
 
- Static Public Member Functions inherited from IPlatformFile
static CORE_API IPlatformFileGetPlatformPhysical ()
 
static CORE_API const TCHARGetPhysicalTypeName ()
 

Static Public Attributes

static PAKFILE_API bool bMountFailOnMissingUtoc = true
 
static PAKFILE_API TMap< FName, TSharedPtr< const struct FPakSignatureFile, ESPMode::ThreadSafe > > PakSignatureFileCache
 
static PAKFILE_API FCriticalSection PakSignatureFileCacheLock
 

Friends

template<bool bInAllowDuplicateKeys>
struct UE::PakFile::Private::FPakEntryFilenameSetKeyFuncs
 
struct UE::PakFile::Private::FHandleMountPaksExDelegate
 

Additional Inherited Members

- Public Types inherited from IPlatformFile
enum class  EOpenReadFlags : uint8 { None = 0 , AllowWrite = 1 << 0 , AllowDelete = 1 << 1 , NoBuffering = 1 << 2 }
 
enum class  EOpenWriteFlags : uint8 { None = 0 , AllowRead = 1 << 0 , Append = 1 << 1 }
 
typedef TFunctionRef< bool(const TCHAR *, bool)> FDirectoryVisitorFunc
 
typedef TFunctionRef< bool(const TCHAR *, const FFileStatData &)> FDirectoryStatVisitorFunc
 
typedef TFunctionRef< bool(const TCHAR *, const FFileJournalData &)> FDirectoryJournalVisitorFunc
 

Detailed Description

Platform file wrapper to be able to use pak files.

Constructor & Destructor Documentation

◆ FPakPlatformFile()

FPakPlatformFile::FPakPlatformFile ( )

Constructor.

Parameters
InLowerLevelWrapper platform file.

◆ ~FPakPlatformFile()

FPakPlatformFile::~FPakPlatformFile ( )
virtual

Destructor.

Member Function Documentation

◆ AnyChunksAvailable()

bool FPakPlatformFile::AnyChunksAvailable ( ) const

Returns true if any of the mounted or pending pak files are chunks (filenames starting pakchunkN)

◆ BroadcastPakChunkSignatureCheckFailure()

void FPakPlatformFile::BroadcastPakChunkSignatureCheckFailure ( const FPakChunkSignatureCheckFailedData InData)
static

◆ BroadcastPakMasterSignatureTableCheckFailure()

PRAGMA_DISABLE_DEPRECATION_WARNINGS void FPakPlatformFile::BroadcastPakMasterSignatureTableCheckFailure ( const FString &  InFilename)
static

◆ BroadcastPakPrincipalSignatureTableCheckFailure()

void FPakPlatformFile::BroadcastPakPrincipalSignatureTableCheckFailure ( const FString &  InFilename)
static

◆ CheckIfPakFilesExist()

bool FPakPlatformFile::CheckIfPakFilesExist ( IPlatformFile LowLevelFile,
const TArray< FString > &  PakFolders 
)
static

Checks if pak files exist in any of the known pak file locations.

◆ ConvertToAbsolutePathForExternalAppForRead()

FString FPakPlatformFile::ConvertToAbsolutePathForExternalAppForRead ( const TCHAR Filename)
inlineoverridevirtual

Converts passed in filename to use an absolute path (for reading).

Parameters
Filenamefilename to convert to use an absolute path, safe to pass in already using absolute path
Returns
filename using absolute path

Reimplemented from IPlatformFile.

◆ ConvertToAbsolutePathForExternalAppForWrite()

FString FPakPlatformFile::ConvertToAbsolutePathForExternalAppForWrite ( const TCHAR Filename)
inlineoverridevirtual

Converts passed in filename to use an absolute path (for writing)

Parameters
Filenamefilename to convert to use an absolute path, safe to pass in already using absolute path
Returns
filename using absolute path

Reimplemented from IPlatformFile.

◆ ConvertToPakRelativePath()

FString FPakPlatformFile::ConvertToPakRelativePath ( const TCHAR Filename,
const FPakFile Pak 
)
inline

Converts a filename to a path inside pak file.

Parameters
FilenameFilename to convert.
PakPak to convert the filename realative to.
Relativefilename.

◆ CopyFile()

bool FPakPlatformFile::CopyFile ( const TCHAR To,
const TCHAR From,
EPlatformFileRead  ReadFlags = EPlatformFileRead::None,
EPlatformFileWrite  WriteFlags = EPlatformFileWrite::None 
)
overridevirtual

Copy a file. This will fail if the destination file already exists.

Parameters
ToFile to copy to.
FromFile to copy from.
ReadFlagsSource file read options.
WriteFlagsDestination file write options.
Returns
true if the file was copied successfully.

Reimplemented from IPlatformFile.

◆ CreateDirectory()

bool FPakPlatformFile::CreateDirectory ( const TCHAR Directory)
overridevirtual

Create a directory and return true if the directory was created or already existed.

Implements IPlatformFile.

◆ CreateDirectoryTree()

bool FPakPlatformFile::CreateDirectoryTree ( const TCHAR Directory)
overridevirtual

Create a directory, including any parent directories and return true if the directory was created or already existed.

Reimplemented from IPlatformFile.

◆ DeleteDirectory()

bool FPakPlatformFile::DeleteDirectory ( const TCHAR Directory)
overridevirtual

Delete a directory and return true if the directory was deleted or otherwise does not exist.

Implements IPlatformFile.

◆ DeleteDirectoryRecursively()

bool FPakPlatformFile::DeleteDirectoryRecursively ( const TCHAR Directory)
overridevirtual

Delete all files and subdirectories in a directory, then delete the directory itself

Parameters
DirectoryThe directory to delete.
Returns
true if the directory was deleted or did not exist.

Reimplemented from IPlatformFile.

◆ DeleteFile()

virtual bool FPakPlatformFile::DeleteFile ( const TCHAR Filename)
inlineoverridevirtual

Delete a file and return true if the file exists. Will not delete read only files.

Implements IPlatformFile.

◆ DirectoryExists()

bool FPakPlatformFile::DirectoryExists ( const TCHAR Directory)
overridevirtual

Return true if the directory exists.

Implements IPlatformFile.

◆ FileExists()

virtual bool FPakPlatformFile::FileExists ( const TCHAR Filename)
inlineoverridevirtual

Return true if the file exists.

Implements IPlatformFile.

◆ FileSize()

virtual int64 FPakPlatformFile::FileSize ( const TCHAR Filename)
inlineoverridevirtual

Return the size of the file, or -1 if it doesn't exist.

Implements IPlatformFile.

◆ FindFileInPakFiles() [1/2]

bool FPakPlatformFile::FindFileInPakFiles ( const TCHAR Filename,
TRefCountPtr< FPakFile > *  OutPakFile = nullptr,
FPakEntry OutEntry = nullptr 
)

Finds a file in all available pak files.

Parameters
FilenameFile to find in pak files.
OutPakFileOptional pointer to a pak file where the filename was found.
Returns
true if the file was found, false otherwise.

◆ FindFileInPakFiles() [2/2]

bool FPakPlatformFile::FindFileInPakFiles ( TArray< FPakListEntry > &  Paks,
const TCHAR Filename,
TRefCountPtr< FPakFile > *  OutPakFile,
FPakEntry OutEntry = nullptr 
)
static

Finds a file in the specified pak files.

Parameters
PaksPak files to find the file in.
FilenameFile to find in pak files.
OutPakFileOptional pointer to a pak file where the filename was found.
Returns
true if the file was found, false otherwise.

◆ FindFiles()

void FPakPlatformFile::FindFiles ( TArray< FString > &  FoundFiles,
const TCHAR Directory,
const TCHAR FileExtension 
)
overridevirtual

Finds all the files within the given directory, with optional file extension filter

Parameters
DirectoryThe directory to iterate the contents of
FileExtensionIf FileExtension is NULL, or an empty string "" then all files are found. Otherwise FileExtension can be of the form .EXT or just EXT and only files with that extension will be returned.
Returns
FoundFiles All the files that matched the optional FileExtension filter, or all files if none was specified.

Reimplemented from IPlatformFile.

◆ FindFilesRecursively()

void FPakPlatformFile::FindFilesRecursively ( TArray< FString > &  FoundFiles,
const TCHAR Directory,
const TCHAR FileExtension 
)
overridevirtual

Finds all the files within the directory tree, with optional file extension filter

Parameters
DirectoryThe starting directory to iterate the contents. This function explores subdirectories
FileExtensionIf FileExtension is NULL, or an empty string "" then all files are found. Otherwise FileExtension can be of the form .EXT or just EXT and only files with that extension will be returned.
Returns
FoundFiles All the files that matched the optional FileExtension filter, or all files if none was specified.

Reimplemented from IPlatformFile.

◆ ForeachPackageInIostoreWhile()

void FPakPlatformFile::ForeachPackageInIostoreWhile ( TFunctionRef< bool(FName)>  Predicate)
static

Iterates Iostore Container while Predicate returns true

◆ GetAccessTimeStamp()

virtual FDateTime FPakPlatformFile::GetAccessTimeStamp ( const TCHAR Filename)
inlineoverridevirtual

Return the last access time of a file. Returns FDateTime::MinValue() on failure

Implements IPlatformFile.

◆ GetFilenameOnDisk()

virtual FString FPakPlatformFile::GetFilenameOnDisk ( const TCHAR Filename)
inlineoverridevirtual

For case insensitive filesystems, returns the full path of the file with the same case as in the filesystem

Implements IPlatformFile.

◆ GetFilenameSecurityDelegate()

FFilenameSecurityDelegate & FPakPlatformFile::GetFilenameSecurityDelegate ( )
static

◆ GetFilenamesFromIostoreByBlockIndex()

void FPakPlatformFile::GetFilenamesFromIostoreByBlockIndex ( const FString &  InContainerName,
const TArray< int32 > &  InBlockIndex,
TArray< FString > &  OutFileList 
)
static

Returns the RelativePathFromMount Filename for every Filename found in the Iostore Container that relates to the provided block indexes

◆ GetFilenamesFromIostoreContainer()

void FPakPlatformFile::GetFilenamesFromIostoreContainer ( const FString &  InContainerName,
TArray< FString > &  OutFileList 
)
static

Returns the RelativePathFromMount Filename for every file found in the given Iostore Container

◆ GetLowerLevel()

virtual IPlatformFile * FPakPlatformFile::GetLowerLevel ( )
inlineoverridevirtual

Gets the platform file wrapped by this file.

Implements IPlatformFile.

◆ GetMountedChunkIds()

void FPakPlatformFile::GetMountedChunkIds ( TSet< int32 > &  OutChunkIds)
inline

Gets a set of the mounted chunk Ids.

◆ GetMountedPakFilenames() [1/2]

void FPakPlatformFile::GetMountedPakFilenames ( TArray< FString > &  PakFilenames)
inline

Get a list of all pak files which have been successfully mounted

◆ GetMountedPakFilenames() [2/2]

void FPakPlatformFile::GetMountedPakFilenames ( TSet< FString > &  PakFilenames)
inline

Get a list of all pak files which have been successfully mounted

◆ GetMountStartupPaksWildCard()

const TCHAR * FPakPlatformFile::GetMountStartupPaksWildCard ( )
static

Get the wild card pattern used to identify paks to load on startup

◆ GetName()

virtual const TCHAR * FPakPlatformFile::GetName ( ) const
inlineoverridevirtual

Gets this platform file type name.

Implements IPlatformFile.

◆ GetPakChunkLocation()

EChunkLocation::Type FPakPlatformFile::GetPakChunkLocation ( int32  InPakchunkIndex) const

Determine location information for a given pakchunk index. Will be DoesNotExist if the pak file wasn't detected, NotAvailable if it exists but hasn't been mounted due to a missing encryption key, or LocalFast if it exists and has been mounted

◆ GetPakCustomEncryptionDelegate()

FPakCustomEncryptionDelegate & FPakPlatformFile::GetPakCustomEncryptionDelegate ( )
static

◆ GetPakEncryptionKey()

void FPakPlatformFile::GetPakEncryptionKey ( FAES::FAESKey OutKey,
const FGuid InEncryptionKeyGuid 
)
static

Helper function for accessing pak encryption key

◆ GetPakFolders()

void FPakPlatformFile::GetPakFolders ( const TCHAR CmdLine,
TArray< FString > &  OutPakFolders 
)
static

Gets all pak file locations.

◆ GetPakSetIndexSettingsDelegate()

PRAGMA_ENABLE_DEPRECATION_WARNINGS FPakSetIndexSettings & FPakPlatformFile::GetPakSetIndexSettingsDelegate ( )
static

◆ GetPakSignatureFile()

TSharedPtr< const FPakSignatureFile, ESPMode::ThreadSafe > FPakPlatformFile::GetPakSignatureFile ( const TCHAR InFilename)
static

Load a pak signature file. Validates the contents by comparing a SHA hash of the chunk table against and encrypted version that is stored within the file. Returns nullptr if the data is missing or fails the signature check. This function also calls the generic pak signature failure delegates if anything is wrong.

◆ GetPakSigningFailureHandlerData()

FPakPlatformFile::FPakSigningFailureHandlerData & FPakPlatformFile::GetPakSigningFailureHandlerData ( )
static

◆ GetPrunedFilenamesInChunk()

void FPakPlatformFile::GetPrunedFilenamesInChunk ( const FString &  InPakFilename,
const TArray< int32 > &  InChunkIDs,
TArray< FString > &  OutFileList 
)

◆ GetPrunedFilenamesInPakFile()

void FPakPlatformFile::GetPrunedFilenamesInPakFile ( const FString &  InPakFilename,
TArray< FString > &  OutFileList 
)

Gets a list of FullPaths (includes Mount directory) for every File in the given Pak's Pruned DirectoryIndex

◆ GetStatData()

FFileStatData FPakPlatformFile::GetStatData ( const TCHAR FilenameOrDirectory)
overridevirtual

Return the stat data for the given file or directory. Check the FFileStatData::bIsValid member before using the returned data

Implements IPlatformFile.

◆ GetTimeStamp()

virtual FDateTime FPakPlatformFile::GetTimeStamp ( const TCHAR Filename)
inlineoverridevirtual

Return the modification time of a file. Returns FDateTime::MinValue() on failure

Implements IPlatformFile.

◆ GetTimeStampPair()

virtual void FPakPlatformFile::GetTimeStampPair ( const TCHAR FilenameA,
const TCHAR FilenameB,
FDateTime OutTimeStampA,
FDateTime OutTimeStampB 
)
inlineoverridevirtual

Reimplemented from IPlatformFile.

◆ GetTypeName()

static const TCHAR * FPakPlatformFile::GetTypeName ( )
inlinestatic

Get the unique name for the pak platform file layer

◆ HandleMountCommand()

void FPakPlatformFile::HandleMountCommand ( const TCHAR Cmd,
FOutputDevice Ar 
)

◆ HandlePakCorruptCommand()

void FPakPlatformFile::HandlePakCorruptCommand ( const TCHAR Cmd,
FOutputDevice Ar 
)

◆ HandlePakListCommand()

void FPakPlatformFile::HandlePakListCommand ( const TCHAR Cmd,
FOutputDevice Ar 
)

◆ HandleReloadPakReadersCommand()

void FPakPlatformFile::HandleReloadPakReadersCommand ( const TCHAR Cmd,
FOutputDevice Ar 
)

◆ HandleUnmountCommand()

void FPakPlatformFile::HandleUnmountCommand ( const TCHAR Cmd,
FOutputDevice Ar 
)

◆ Initialize()

bool FPakPlatformFile::Initialize ( IPlatformFile Inner,
const TCHAR CmdLine 
)
overridevirtual

Initializes platform file.

Parameters
InnerPlatform file to wrap by this file.
CmdLineCommand line to parse.
Returns
true if the initialization was successful, false otherise.

Implements IPlatformFile.

◆ InitializeNewAsyncIO()

void FPakPlatformFile::InitializeNewAsyncIO ( )
overridevirtual

Performs initialization of the platform file after the new async IO has been enabled

Reimplemented from IPlatformFile.

◆ IsReadOnly()

virtual bool FPakPlatformFile::IsReadOnly ( const TCHAR Filename)
inlineoverridevirtual

Return true if the file is read only.

Implements IPlatformFile.

◆ IsSymlink()

virtual ESymlinkResult FPakPlatformFile::IsSymlink ( const TCHAR Filename)
inlineoverridevirtual

Return true if the file is a symbolic link

Reimplemented from IPlatformFile.

◆ IterateDirectory() [1/3]

virtual bool IPlatformFile::IterateDirectory ( const TCHAR Directory,
FDirectoryVisitor Visitor 
)
virtual

Call the Visit function of the visitor once for each file or directory in a single directory. This function does not explore subdirectories.

Parameters
DirectoryThe directory to iterate the contents of.
VisitorVisitor to call for each element of the directory
Returns
false if the directory did not exist or if the visitor returned false.

Implements IPlatformFile.

◆ IterateDirectory() [2/3]

bool IPlatformFile::IterateDirectory ( const TCHAR Directory,
FDirectoryVisitorFunc  Visitor 
)
virtual

Call the visitor once for each file or directory in a single directory. This function does not explore subdirectories.

Parameters
DirectoryThe directory to iterate the contents of.
VisitorVisitor to call for each element of the directory (see FDirectoryVisitor::Visit for the signature)
Returns
false if the directory did not exist or if the visitor returned false.

Reimplemented from IPlatformFile.

◆ IterateDirectory() [3/3]

bool FPakPlatformFile::IterateDirectory ( const TCHAR Directory,
IPlatformFile::FDirectoryVisitor Visitor 
)
overridevirtual

Call the Visit function of the visitor once for each file or directory in a single directory. This function does not explore subdirectories.

Parameters
DirectoryThe directory to iterate the contents of.
VisitorVisitor to call for each element of the directory
Returns
false if the directory did not exist or if the visitor returned false.

Implements IPlatformFile.

◆ IterateDirectoryRecursively() [1/3]

bool IPlatformFile::IterateDirectoryRecursively ( const TCHAR Directory,
FDirectoryVisitor Visitor 
)
virtual

Call the Visit function of the visitor once for each file or directory in a directory tree. This function explores subdirectories.

Parameters
DirectoryThe directory to iterate the contents of, recursively.
VisitorVisitor to call for each element of the directory and each element of all subdirectories.
Returns
false if the directory did not exist or if the visitor returned false.

Reimplemented from IPlatformFile.

◆ IterateDirectoryRecursively() [2/3]

bool IPlatformFile::IterateDirectoryRecursively ( const TCHAR Directory,
FDirectoryVisitorFunc  Visitor 
)
virtual

Call the Visit function of the visitor once for each file or directory in a directory tree. This function explores subdirectories.

Parameters
DirectoryThe directory to iterate the contents of, recursively.
VisitorVisitor to call for each element of the directory and each element of all subdirectories (see FDirectoryVisitor::Visit for the signature).
Returns
false if the directory did not exist or if the visitor returned false.

Reimplemented from IPlatformFile.

◆ IterateDirectoryRecursively() [3/3]

bool FPakPlatformFile::IterateDirectoryRecursively ( const TCHAR Directory,
IPlatformFile::FDirectoryVisitor Visitor 
)
overridevirtual

Call the Visit function of the visitor once for each file or directory in a directory tree. This function explores subdirectories.

Parameters
DirectoryThe directory to iterate the contents of, recursively.
VisitorVisitor to call for each element of the directory and each element of all subdirectories.
Returns
false if the directory did not exist or if the visitor returned false.

Reimplemented from IPlatformFile.

◆ IterateDirectoryStat() [1/3]

virtual bool IPlatformFile::IterateDirectoryStat ( const TCHAR Directory,
FDirectoryStatVisitor Visitor 
)
virtual

Call the Visit function of the visitor once for each file or directory in a single directory. This function does not explore subdirectories.

Parameters
DirectoryThe directory to iterate the contents of.
VisitorVisitor to call for each element of the directory
Returns
false if the directory did not exist or if the visitor returned false.

Implements IPlatformFile.

◆ IterateDirectoryStat() [2/3]

bool IPlatformFile::IterateDirectoryStat ( const TCHAR Directory,
FDirectoryStatVisitorFunc  Visitor 
)
virtual

Call the visitor once for each file or directory in a single directory. This function does not explore subdirectories.

Parameters
DirectoryThe directory to iterate the contents of.
VisitorVisitor to call for each element of the directory (see FDirectoryStatVisitor::Visit for the signature)
Returns
false if the directory did not exist or if the visitor returned false.

Reimplemented from IPlatformFile.

◆ IterateDirectoryStat() [3/3]

bool FPakPlatformFile::IterateDirectoryStat ( const TCHAR Directory,
IPlatformFile::FDirectoryStatVisitor Visitor 
)
overridevirtual

Call the Visit function of the visitor once for each file or directory in a single directory. This function does not explore subdirectories.

Parameters
DirectoryThe directory to iterate the contents of.
VisitorVisitor to call for each element of the directory
Returns
false if the directory did not exist or if the visitor returned false.

Implements IPlatformFile.

◆ IterateDirectoryStatRecursively() [1/3]

bool IPlatformFile::IterateDirectoryStatRecursively ( const TCHAR Directory,
FDirectoryStatVisitor Visitor 
)
virtual

Call the Visit function of the visitor once for each file or directory in a directory tree. This function explores subdirectories.

Parameters
DirectoryThe directory to iterate the contents of, recursively.
VisitorVisitor to call for each element of the directory and each element of all subdirectories.
Returns
false if the directory did not exist or if the visitor returned false.

Reimplemented from IPlatformFile.

◆ IterateDirectoryStatRecursively() [2/3]

bool IPlatformFile::IterateDirectoryStatRecursively ( const TCHAR Directory,
FDirectoryStatVisitorFunc  Visitor 
)
virtual

Call the Visit function of the visitor once for each file or directory in a directory tree. This function explores subdirectories.

Parameters
DirectoryThe directory to iterate the contents of, recursively.
VisitorVisitor to call for each element of the directory and each element of all subdirectories (see FDirectoryStatVisitor::Visit for the signature).
Returns
false if the directory did not exist or if the visitor returned false.

Reimplemented from IPlatformFile.

◆ IterateDirectoryStatRecursively() [3/3]

bool FPakPlatformFile::IterateDirectoryStatRecursively ( const TCHAR Directory,
IPlatformFile::FDirectoryStatVisitor Visitor 
)
overridevirtual

Call the Visit function of the visitor once for each file or directory in a directory tree. This function explores subdirectories.

Parameters
DirectoryThe directory to iterate the contents of, recursively.
VisitorVisitor to call for each element of the directory and each element of all subdirectories.
Returns
false if the directory did not exist or if the visitor returned false.

Reimplemented from IPlatformFile.

◆ MakeUniquePakFilesForTheseFiles()

void FPakPlatformFile::MakeUniquePakFilesForTheseFiles ( const TArray< TArray< FString > > &  InFiles)
virtual

Make unique in memory pak files from a list of named files

Reimplemented from IPlatformFile.

◆ Mount() [1/2]

bool FPakPlatformFile::Mount ( const FPakMountArgs MountArgs,
FIoStatus OutIoMountStatus = nullptr,
FPakListEntry *  OutPakListEntry = nullptr 
)

Mounts a pak file at the specified path.

In most cases, this should not be called directly. Instead use the mounting delegates in FCoreDelegates

Parameters
MountArgsmount arguments
OutIoMountStatusStatus of the pak or associated iostore mount
OutPakListEntryfor internal use

◆ Mount() [2/2]

bool FPakPlatformFile::Mount ( const TCHAR InPakFilename,
uint32  PakOrder,
const TCHAR InPath = nullptr,
bool  bLoadIndex = true,
FPakListEntry *  OutPakListEntry = nullptr 
)

Mounts a pak file at the specified path.

In most cases, this should not be called directly. Instead use the mounting delegates in FCoreDelegates

Parameters
InPakFilenamePak filename.
InPathPath to mount the pak at.
OutPakListEntryfor internal use
OutIoMountStatusStatus of the pak or associated iostore mount

◆ MountAllPakFiles() [1/2]

int32 FPakPlatformFile::MountAllPakFiles ( const TArray< FString > &  PakFolders)

◆ MountAllPakFiles() [2/2]

int32 FPakPlatformFile::MountAllPakFiles ( const TArray< FString > &  PakFolders,
const FString &  WildCard 
)

◆ MoveFile()

virtual bool FPakPlatformFile::MoveFile ( const TCHAR To,
const TCHAR From 
)
inlineoverridevirtual

Attempt to move a file. Return true if successful. Will not overwrite existing files.

Implements IPlatformFile.

◆ OpenAsyncRead()

IAsyncReadFileHandle * FPakPlatformFile::OpenAsyncRead ( const TCHAR Filename,
bool  bAllowWrite = false 
)
overridevirtual

Open a file for async reading. This call does not hit the disk or block.

Parameters
Filenamefile to be opened
bAllowWrite(applies to certain platforms only) whether this file is allowed to be written to by other processes. This flag is needed to open files that are currently being written to as well.
Returns
Close the file by delete'ing the handle. A non-null return value does not mean the file exists, since that may not be determined yet.

Reimplemented from IPlatformFile.

◆ OpenMappedEx()

FOpenMappedResult FPakPlatformFile::OpenMappedEx ( const TCHAR Filename,
EOpenReadFlags  OpenOptions = EOpenReadFlags::None,
int64  MaximumSize = 0 
)
overridevirtual

Open a file for async reading. This call does hit the disk; it is synchronous open.

Parameters
FilenameFile to be mapped. This doesn't actually map anything, just opens the file.
OpenOptionsAllows specifying map to be writable via AllowWrite or be ReadOnly by deafault.
Returns
Close the file by deleting the handle. A non-null return value does mean the file exists. Null can be returned for many reasons even if the file exists. Perhaps this platform does not support mapped files, or this file is compressed in a pak file. Generally you attempt to open mapped, and if that fails, then use other file operations instead.

Reimplemented from IPlatformFile.

◆ OpenRead()

IFileHandle * FPakPlatformFile::OpenRead ( const TCHAR Filename,
bool  bAllowWrite = false 
)
overridevirtual

Attempt to open a file for reading. Please consider using the new overload that takes EReadFlags instead of bools as parameters.

Parameters
Filenamefile to be opened
bAllowWrite(applies to certain platforms only) whether this file is allowed to be written to by other processes. This flag is needed to open files that are currently being written to as well.
Returns
If successful will return a non-nullptr pointer. Close the file by deleting the handle.

Implements IPlatformFile.

◆ OpenWrite()

IFileHandle * FPakPlatformFile::OpenWrite ( const TCHAR Filename,
bool  bAppend = false,
bool  bAllowRead = false 
)
overridevirtual

Attempt to open a file for writing. If successful will return a non-nullptr pointer. Close the file by deleting the handle.

Implements IPlatformFile.

◆ OptimizeMemoryUsageForMountedPaks()

void FPakPlatformFile::OptimizeMemoryUsageForMountedPaks ( )

◆ RefreshPakChunkIndicies()

void FPakPlatformFile::RefreshPakChunkIndicies ( )

Requests that all the known paks re-evaluate and set their PakchunkIndex value. Used to allow the AssetManager inform the pak file system about potential name pak chunk overrides.

◆ ReleaseOldReaders()

void FPakPlatformFile::ReleaseOldReaders ( )

◆ ReloadPakReaders()

bool FPakPlatformFile::ReloadPakReaders ( )

Re-creates all the pak readers

◆ RemoveCachedPakSignaturesFile()

void FPakPlatformFile::RemoveCachedPakSignaturesFile ( const TCHAR InFilename)
static

Remove the intenrally cached pointer to the signature file for the specified pak

◆ SetAsyncMinimumPriority()

void FPakPlatformFile::SetAsyncMinimumPriority ( EAsyncIOPriorityAndFlags  MinPriority)
overridevirtual

Controls if the pak precacher should process precache requests. Requests below this threshold will not get precached. Without this throttle, quite a lot of memory can be consumed if the disk races ahead of the CPU.

Parameters
MinPrioritythe minimum priority at which requests will get precached

Reimplemented from IPlatformFile.

◆ SetLowerLevel()

virtual void FPakPlatformFile::SetLowerLevel ( IPlatformFile NewLowerLevel)
inlineoverridevirtual

Sets the platform file wrapped by this file.

Implements IPlatformFile.

◆ SetMountStartupPaksWildCard()

void FPakPlatformFile::SetMountStartupPaksWildCard ( const FString &  WildCard)
static

Overrides the wildcard used for searching paks. Call before initialization

◆ SetReadOnly()

virtual bool FPakPlatformFile::SetReadOnly ( const TCHAR Filename,
bool  bNewReadOnlyValue 
)
inlineoverridevirtual

Attempt to change the read only status of a file. Return true if successful.

Implements IPlatformFile.

◆ SetTimeStamp()

virtual void FPakPlatformFile::SetTimeStamp ( const TCHAR Filename,
FDateTime  DateTime 
)
inlineoverridevirtual

Sets the modification time of a file

Implements IPlatformFile.

◆ ShouldBeUsed()

bool FPakPlatformFile::ShouldBeUsed ( IPlatformFile Inner,
const TCHAR CmdLine 
) const
overridevirtual

Checks if this platform file should be used even though it was not asked to be. i.e. pak files exist on disk so we should use a pak file

Reimplemented from IPlatformFile.

◆ Tick()

void FPakPlatformFile::Tick ( )
overridevirtual

Platform file can override this to get a regular tick from the engine

Reimplemented from IPlatformFile.

◆ Unmount()

bool FPakPlatformFile::Unmount ( const TCHAR InPakFilename)

Friends And Related Symbol Documentation

◆ UE::PakFile::Private::FHandleMountPaksExDelegate

Handler for delegate to prompt us to load multiple containers.

◆ UE::PakFile::Private::FPakEntryFilenameSetKeyFuncs

template<bool bInAllowDuplicateKeys>
friend struct UE::PakFile::Private::FPakEntryFilenameSetKeyFuncs
friend

Member Data Documentation

◆ bMountFailOnMissingUtoc

bool FPakPlatformFile::bMountFailOnMissingUtoc = true
static

◆ PakSignatureFileCache

TMap< FName, TSharedPtr< const FPakSignatureFile, ESPMode::ThreadSafe > > FPakPlatformFile::PakSignatureFileCache
static

Precaching

◆ PakSignatureFileCacheLock

FCriticalSection FPakPlatformFile::PakSignatureFileCacheLock
static

The documentation for this class was generated from the following files: