Navigation
API > API/Runtime > API/Runtime/PakFile
Inheritance Hierarchy
- FNoncopyable
- FRefCountBase
- IPakFile
- FPakFile
References
| Module | PakFile |
| Header | /Engine/Source/Runtime/PakFile/Public/IPlatformFilePak.h |
| Include | #include "IPlatformFilePak.h" |
Syntax
class FPakFile :
private FNoncopyable,
public FRefCountBase,
public IPakFile
Remarks
Pak file.
Constructors
| Type | Name | Description | |
|---|---|---|---|
| Creates a pak file using the supplied archive. | |||
FPakFile
(
IPlatformFile* LowerLevel, |
Creates a pak file using the supplied file handle. |
Destructors
No destructors are accessible with public or protected access.
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | Check () |
Checks the validity of the pak data by reading out the data for every file in the pak | |
| bool |
DirectoryExistsInPruned
(
const TCHAR* InPath |
Checks if a directory exists in pak file. | |
| void | EncodePakEntriesIntoIndex
(
int32 InNumEntries, |
||
| EFindResult | |||
| const FPakEntryLocation * | FindLocationFromIndex
(
const FString& FullPath, |
Lookup the FPakEntryLocation stored in the given PathHashIndex, return nullptr if not found | |
| const FPakEntryLocation * | FindLocationFromIndex
(
const FString& FullPath, |
Lookup the FPakEntryLocation stored in the given DirectoryIndex, return nullptr if not found | |
| const FPakDirectory * | FindPrunedDirectory
(
const TCHAR* InPath |
Finds a directory in pak file. | |
| void | FindPrunedFilesAtPath
(
ContainerType& OutFiles, |
Looks for files or directories within the Pruned DirectoryIndex of the pak file. | |
| int32 | |||
| ECacheType | GetCacheType () |
||
| const FString & | GetFilename () |
Gets pak filename. | |
| FName | |||
| const FPakInfo & | GetInfo () |
Gets this pak file info. | |
| bool | GetIsMounted () |
||
| const FString & | Gets pak file mount point. | ||
| EFindResult | GetPakEntry
(
const FPakEntryLocation& FPakEntryLocation, |
Returns the FPakEntry pointed to by the given FPakEntryLocation inside the given EncodedPakEntries or Files Can return Found or Deleted; if the FPakEntryLocation is invalid this function assumes the FPakEntry exists in this pack but as a deleted file If OutEntry is non-null, populates it with a copy of the FPakEntry found, or sets it to an FPakEntry with SetDeleteRecord(true) if not found | |
| void | GetPrunedFilenames
(
TArray< FString >& OutFileList |
Returns the FullPath (includes Mount) Filename found in Pruned DirectoryIndex | |
| void | GetPrunedFilenamesInChunk
(
const TArray< int32 >& InChunkIDs, |
Returns the RelativePathFromMount Filename for every Filename found in the Pruned DirectoryIndex that points to a PakEntry in the given Chunk | |
| const TCHAR * | GetRelativeFilePathFromMountPointer
(
const FString& Child, |
Helper function to return Filename's relative path from the mount point. | |
| bool | GetRelativePathFromMountInline
(
FString& Child, |
Helper function to return Child's relative path from the mount point. | |
| FSharedPakReader | GetSharedReader
(
IPlatformFile* LowerLevel |
Gets shared pak file archive for given thread. | |
| const FDateTime & | GetTimestamp () |
Gets this pak file's tiemstamp. | |
| bool | |||
| bool | HasFilenames () |
Returns whether filenames currently exist in the DirectoryIndex for all files in the Pak. | |
| uint64 | HashPath
(
const TCHAR* RelativePathFromMount, |
Hash the given full-path filename using the hash function used by FPakFiles, with the given FPakFile-specific seed, with version provided for legacy pak files that used different hash function | |
| bool | Returns the global,const flag for whether the current process is allowing PakFiles to keep their entire DirectoryIndex (if it exists in the PakFile on disk) rather than pruning it | ||
| bool | Returns the global,const flag for whether UnrealPak should write a copy of the full DirectoryIndex to the PakFile | ||
| bool | Returns the global,const flag for whether UnrealPak should write a copy of the full PathHashIndex and Pruned DirectoryIndex to the PakFile | ||
| bool | IsPathInDirectoryFormat
(
const FString& Path |
Helper function to check that the given string is in our directory format (ends with '/') | |
| bool | IsValid () |
Checks if the pak file is valid. | |
| void | MakeDirectoryFromPath
(
FString& Path |
Helper function to modify the given string to append '/' at the end of path to normalize directory names for hash and string compares | |
| FString | PakPathCombine
(
const FString& Parent, |
Helper function to join two path strings that are in the PakPath format | |
| bool | Checks if the pak has valid chunk signature checking data, and that the data passed the initial signing check | ||
| void | PruneDirectoryIndex
(
FDirectoryIndex& InOutDirectoryIndex, |
Given a directory index, remove entries from it that are directed by ini to not have filenames kept at runtime. | |
| void | ReadHashFromPayload
(
const FPakEntry& PakEntry, |
FPakFile helper functions shared between the runtime and UnrealPak.exe. | |
| bool | RecreatePakReaders
(
IPlatformFile* LowerLevel |
Recreates the pak reader for each thread | |
| void | ReleaseOldReaders
(
double MaxAgeSeconds |
Delete all readers that haven't been used in MaxAgeSeconds. | |
| void | ReturnSharedReader
(
FArchive* SharedReader |
Return a shared pak reader. Should only be called from the FSharedPakReader's destructor. | |
| void | SetCacheIndex
(
int32 InCacheIndex |
||
| void | SetCacheType
(
ECacheType InCacheType |
||
| void | SetIsMounted
(
bool bInIsMounted |
||
| void | SetMountPoint
(
const TCHAR* Path |
Sets the pak file mount point. | |
| void | SetUnderlyingCacheTrimDisabled
(
bool InUnderlyingCacheTrimDisabled |
||
| bool | SplitPathInline
(
FString& InOutPath, |
Helper function to split a PakDirectoryIndex-Formatted PathName into its PakDirectoryIndex-Formatted parent directory and the CleanFileName | |
| int64 | TotalSize () |
Overridden from IPakFile
| Type | Name | Description | |
|---|---|---|---|
| int32 | GetNumFiles () |
Gets the number of files in this pak. | |
| bool | PakContains
(
const FString& Filename |
Return whether the Pak has an entry for the given FileName. | |
| const FString & | |||
| int32 | |||
| const FString & | IPakFile interface, for users of PakFiles that cannot have a dependency on this header. | ||
| void | PakVisitPrunedFilenames
(
IPlatformFile::FDirectoryVisitor& Visitor |
Calls the given Visitor on every FileName in the Pruned Directory Index. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FArchiveAndLastAccessTime | |||
| FBaseIterator | Base functionality for iterating over the DirectoryIndex. | ||
| FFileIterator | |||
| FFilenameIterator | Iterator class used to iterate over just the files in the pak for which we have filenames. | ||
| FIndexSettings | |||
| FPakEntryIterator | Iterator class for every FPakEntry in the FPakFile, but does not provide filenames unless the PakFile has an unpruned DirectoryIndex. | ||
| FScopedPakDirectoryIndexAccess | A ReadLock wrapper that must be used to prevent threading errors around any call to FindPrunedDirectory or internal uses of DirectoryIndex |
Enums
| Type | Name | Description | |
|---|---|---|---|
| ECacheType | Pak files can share a cache or have their own | ||
| EFindResult | Finds an entry in the pak file matching the given filename. |
Typedefs
| Name | Description |
|---|---|
| FDirectoryIndex | Index data that keeps an in-memory directoryname/filename tree to map a Filename to an FPakEntryLocation |
| FPathHashIndex | Index data that provides a map from the hash of a Filename to an FPakEntryLocation |
| ReadNextEntryFunction | Read a list of (Filename, FPakEntry) pairs from a provided enumeration, attempt to encode each one, store each one in the appropriate given encoded and/or unencoded array, and populate the given Directories to map each filename to the location for the FPakEntry |
Constants
| Name | Description |
|---|---|
| bSomePakNeedsPruning | Global flag for whether a Pak has indicated it needs Pruning |