FPreloadableFile

An [FPreloadableArchive](API\Runtime\Core\Misc\FPreloadableArchive) that is customized for reading files from [IFileManager](API\Runtime\Core\HAL\IFileManager).

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Misc/PreloadableFile.h

Include

#include "Misc/PreloadableFile.h"

Syntax

class FPreloadableFile : public FPreloadableArchive

Remarks

An FPreloadableArchive that is customized for reading files from IFileManager.

This class also supports registration of instances of this class by filename, which other systems in the engine can use to request an FArchive for the preload file, if it exists, replacing a call they would otherwise make to IFileManager::Get().CreateFileReader.

As with the base class, the preloading can work in either PreloadBytes or PreloadHandle mode.

Activate PreloadBytes mode by passing Flags::PreloadBytes to InitializeAsync. Activate PreloadHandle mode by passing Flags::PreloadHandle to InitializeAsync, optionally or'd with Flags::Prime.

Constructors

Name Description

Public function

FPreloadableFile

(
    FStringView FileName
)

Functions

Name Description

Public function

void

 

InitializeAsync

(
    uint32 InFlags,
    int64 PrimeSize
)

Initialize the FPreloadableFile asynchronously, performing FileOpen operations on another thread.

Public function Static

bool

 

TryRegister

(
    const TSharedPtr< FPreloadableFile ...
)

Registration.

Public function Static

FArchive ...

 

TryTakeArchive

(
    const TCHAR* FileName
)

Look up an FPreloadableFile instance registered for the given FileName, and return an FArchive from it.

Public function Static

bool

 

UnRegister

(
    const TSharedPtr< FPreloadableFile ...
)

Remove the FPreloadableFile instance if it is registered for its FileName.

Constants

Name

Description

RegisteredFiles

Map used for TryTakeArchive registration.