FFileHelper

Windows
MacOS
Linux

References

Module

Core

Header

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

Include

#include "Misc/FileHelper.h"

Syntax

struct FFileHelper

Functions

Name Description

Public function Static

void

 

BufferToString

(
    FString & Result,
    const uint8 * Buffer,
    int32 Size
)

Load a text file to an FString .

Public function Static

bool

 

CreateBitmap

(
    const TCHAR * Pattern,
    int32 DataWidth,
    int32 DataHeight,
    const FColor * Data,
    FIntRect * SubRectangle,
    IFileManager * FileManager,
    FString * OutFilename,
    bool bInWriteAlpha,
    EChannelMask ChannelMask
)

Saves a 24/32Bit BMP file to disk

Saves a 24Bit BMP file to disk

Public function Static

void

 

GenerateDateTimeBasedBitmapFilename

(
    const FString & Pattern,
    const FString & Extension,
    FString & OutFilename
)

Generates the next unique bitmap filename with a specified extension

Public function Static

bool

 

GenerateNextBitmapFilename

(
    const FString & Pattern,
    const FString & Extension,
    FString & OutFilename,
    IFileManager * FileManager
)

Generates the next unique bitmap filename with a specified extension

Public function Static

bool

 

IsFilenameValidForSaving

(
    const FString & Filename,
    FText & OutError
)

Checks to see if a filename is valid for saving.

Public function Static

bool

 

LoadANSITextFileToStrings

(
    const TCHAR * InFilename,
    IFileManager * InFileManager,
    TArray < FString >& OutStrings
)

Load the given ANSI text file to an array of strings - one FString per line of the file.

Public function Static

bool

 

LoadFileToArray

(
    TArray < uint8 >& Result,
    const TCHAR * Filename,
    uint32 Flags
)

Load a binary file to a dynamic array with two uninitialized bytes at end as padding.

Public function Static

bool

 

LoadFileToArray

(
    TArray64< uint8 >& Result,
    const TCHAR * Filename,
    uint32 Flags
)

Load a binary file to a dynamic array with two uninitialized bytes at end as padding.

Public function Static

bool

 

LoadFileToString

(
    FString & Result,
    FArchive & Reader,
    EHashOptions VerifyFlags
)

Load a text file to an FString .

Public function Static

bool

 

LoadFileToString

(
    FString & Result,
    const TCHAR * Filename,
    EHashOptions VerifyFlags,
    uint32 ReadFlags
)

Load a text file to an FString .

Public function Static

bool

 

LoadFileToString

(
    FString & Result,
    IPlatformFile * PlatformFile,
    const TCHAR * Filename,
    EHashOptions VerifyFlags
)

Load a text file to an FString .

Public function Static

bool

 

LoadFileToStringArray

(
    TArray < FString >& Result,
    const TCHAR * Filename
)

Load a text file to an array of strings.

Public function Static

bool

 

LoadFileToStringArrayWithPredicate

(
    TArray < FString >& Result,
    const TCHAR * Filename,
    TFunctionRef < bool &)...
)

Load a text file to an array of strings, filtered by a user-defined predicate.

Public function Static

bool

 

SaveArrayToFile

(
    TArrayView < const uint8 > Array,
    const TCHAR * Filename,
    IFileManager * FileManager,
    uint32 WriteFlags
)

Save a binary array to a file.

Public function Static

bool

 

SaveArrayToFile

(
    const TArray64< uint8 >& Array,
    const TCHAR * Filename,
    IFileManager * FileManager,
    uint32 WriteFlags
)

Save a binary array to a file.

Public function Static

bool

 

SaveStringArrayToFile

(
    const TArray < FString >& Lines,
    const TCHAR * Filename,
    EEncodingOptions EncodingOptions,
    IFileManager * FileManager,
    uint32 WriteFlags
)

Write the FString to a file.

Public function Static

bool

 

SaveStringToFile

(
    FStringView String,
    const TCHAR * Filename,
    EEncodingOptions EncodingOptions,
    IFileManager * FileManager,
    uint32 WriteFlags
)

Write the FString to a file.

Enums

Deprecated Functions

Name Description

Public function Static

bool

 

LoadFileToStringArray

(
    TArray < FString >& Result,
    const TCHAR * Filename,
    EHashOptions VerifyFlags
)

LoadFileToStringArray no longer supports VerifyFlags. You can use UE::String::ParseLines to split up a string loaded with LoadFileToString

Public function Static

bool

 

LoadFileToStringArrayWithPredicate

(
    TArray < FString >& Result,
    const TCHAR * Filename,
    TFunctionRef < bool &)...,
    EHashOptions VerifyFlags
)

LoadFileToStringArrayWithPredicate no longer supports VerifyFlags. You can use UE::String::ParseLines to split up a string loaded with LoadFileToString

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback