Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/FFileHelper
Description
Asynchronously load a text file to an FString. Supports all combination of ANSI/Unicode files and platforms.
e.g. FFileHelper::LoadFileToStringAsync(TEXT("foo.txt"),{});FFileHelper::LoadFileToStringAsync(TEXT("foo.txt"),{.OverridePlatformFile=MyPlatformFile,.FileOpenFlags=IPlatformFile::EOpenReadFlags::NoBuffering});
| Name | LoadFileToStringAsync |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/FileHelper.h |
| Include Path | #include "Misc/FileHelper.h" |
| Source | /Engine/Source/Runtime/Core/Private/Misc/FileHelper.cpp |
static UE::Tasks::TTask < TValueOrError < FString , FFileSystemError > > LoadFileToStringAsync
(
const TCHAR * Filename,
FLoadFileAsyncOptions Options
)
Parameters
| Name | Remarks |
|---|---|
| Filename | Name of the file to load |
| Options | Additional options to control behavior, use designated initializers for customization. |