![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <FileHelper.h>
Public Types | |
| enum class | EHashOptions { None =0 , EnableVerify =1<<0 , ErrorMissingHash =1<<1 } |
| enum class | EEncodingOptions { AutoDetect , ForceAnsi , ForceUnicode , ForceUTF8 , ForceUTF8WithoutBOM } |
| enum class | EColorChannel { R , G , B , A , All } |
Public Member Functions | |
| enum | UE_DEPRECATED (5.0, "EChannelMask has been deprecated in favor of EColorChannel") EChannelMask |
|
strong |
|
strong |
|
strong |
Load a text file to an FString. Supports all combination of ANSI/Unicode files and platforms.
Converts an arbitrary text buffer to an FString. Supports all combination of ANSI/Unicode files and platforms.
|
static |
|
static |
Saves a 24/32Bit BMP file to disk for debug image dump purposes
for general image saving (to BMP or any other format); use FImageUtils::SaveImage instead CreateBitmap is mainly for debug dump images
note this also calls SendDataToPCViaUnrealConsole and uses GenerateNextBitmapFilename if Pattern does not have ".bmp" on it
| Pattern | filename with path, must not be 0, if with "bmp" extension (e.g. "out.bmp") the filename stays like this, if without (e.g. "out") automatic index numbers are addended (e.g. "out00002.bmp") |
| DataWidth | - Width of the bitmap supplied in Data >0 |
| DataHeight | - Height of the bitmap supplied in Data >0 |
| Data | must not be 0 |
| SubRectangle | optional, specifies a sub-rectangle of the source image to save out. If NULL, the whole bitmap is saved |
| FileManager | must not be 0 |
| OutFilename | optional, if specified filename will be output |
| bInWriteAlpha | optional, specifies whether to write out the alpha channel. Will force BMP V4 format. |
| ColorChannel | optional, specifies a specific channel to write out (will be written out to all channels gray scale). |
|
static |
Generates the next unique bitmap filename with a specified extension
| Pattern | Filename with path, but without extension. |
| Extension | File extension to be appended |
| OutFilename | Reference to an FString where the newly generated filename will be placed |
Generates the next unique bitmap filename with a specified extension
| Pattern | Filename with path, but without extension. @oaran Extension File extension to be appended |
| OutFilename | Reference to an FString where the newly generated filename will be placed |
|
static |
Generates the next unique bitmap filename with a specified extension
| Pattern | Filename with path, but without extension. |
| Extension | File extension to be appended |
| OutFilename | Reference to an FString where the newly generated filename will be placed |
| FileManager | Reference to a IFileManager (or the global instance by default) |
Generates the next unique bitmap filename with a specified extension
| Pattern | Filename with path, but without extension. @oaran Extension File extension to be appended |
| OutFilename | Reference to an FString where the newly generated filename will be placed |
| FileManager | Reference to a IFileManager (or the global instance by default) |
Checks to see if a filename is valid for saving. A filename must be under FPlatformMisc::GetMaxPathLength() to be saved
| Filename | Filename, with or without path information, to check. |
| OutError | If an error occurs, this is the reason why |
|
static |
Load the given ANSI text file to an array of strings - one FString per line of the file. Intended for use in simple text parsing actions
| InFilename | The text file to read, full path |
| InFileManager | The filemanager to use - NULL will use &IFileManager::Get() |
| OutStrings | The array of FStrings to fill in |
|
static |
Load a binary file a block at a time into a buffer and call the visitor each time the buffer is populated with a new block. This uses less memory and has higher cache coherency than loading the entire file into a block of bytes, and is more performant than reading the file a byte at a time. Useful for e.g. hashing or parsing.
| Filename | The file to read |
| BlockVisitor | Function called repeatedly with each sequential block. Size of the input might change for performance and should not be assumed. Possibly the entire file will be passed in a single block. If LoadFileInBlocks returns true, the sum of sizes in each call to BlockVisitor equals the size of the requested range of the the file on disk. If the requested range has size 0, LoadFileInBlocks will return true and the BlockVisitor will not be called. |
| Offset | Start of the range of bytes to read from the file. If less than zero or larger than filesize, it will be silently clamped to the [0,FileSize] range. This may result in LoadFileInBlocks returning true but using an empty range and not calling BlockVisitor. |
| Length | of the range of bytes to read from the file. If less than zero, all bytes between Offset and end of file are read. If larger than the size of the range between Offset and end of file, it will be silently shortened to the size of the range. |
| Flags | Flags to pass to IFileManager::CreateFileReader |
| BlockSize | Size of the internally-allocated buffer to read bytes into and pass to each call to BlockVisitor. Sizes <= 0 use the default-selected block size for the current platform. |
|
static |
Load a binary file to a dynamic array with two uninitialized bytes at end as padding.
| Result | Receives the contents of the file |
| Filename | The file to read |
| Flags | Flags to pass to IFileManager::CreateFileReader |
Load a binary file to a dynamic array with two uninitialized bytes at end as padding. TArray64 version.
|
static |
Load a binary file to a dynamic array with two uninitialized bytes at end as padding.
| Result | Receives the contents of the file |
| Filename | The file to read |
| Flags | Flags to pass to IFileManager::CreateFileReader |
Load a binary file to a dynamic array with two uninitialized bytes at end as padding.
|
static |
Load a text file to an FString. Supports all combination of ANSI/Unicode files and platforms.
| Result | String representation of the loaded file |
| Filename | Name of the file to load |
| VerifyFlags | Flags controlling the hash verification behavior ( see EHashOptions ) |
Load a text file to an FString. Supports all combination of ANSI/Unicode files and platforms.
| Result | string representation of the loaded file |
| Filename | name of the file to load |
| VerifyFlags | flags controlling the hash verification behavior ( see EHashOptions ) |
|
static |
Loads a text file from an FArchive to an FString. Supports all combination of ANSI/Unicode files and platforms.
| Result | String representation of the loaded file |
| Reader | The archive to load from |
| VerifyFlags | Flags controlling the hash verification behavior ( see EHashOptions ) |
|
static |
Load a text file to an FString. Supports all combination of ANSI/Unicode files and platforms.
| Result | String representation of the loaded file |
| PlatformFile | PlatformFile interface to use |
| Filename | Name of the file to load |
| VerifyFlags | Flags controlling the hash verification behavior ( see EHashOptions ) |
|
static |
Load a text file to an array of strings. Supports all combination of ANSI/Unicode files and platforms.
| Result | String representation of the loaded file |
| Filename | Name of the file to load |
|
static |
|
static |
Load a text file to an array of strings, filtered by a user-defined predicate. Supports all combination of ANSI/Unicode files and platforms.
| Result | String representation of the loaded file |
| Filename | Name of the file to load |
| Predicate | Condition for whether or not to add the line to the array |
|
static |
|
static |
Load a text file and invoke a visitor for each line. Supports all combination of ANSI/Unicode files and platforms.
| Filename | Name of the file to load |
| Visitor | Visitor to invoke for each non-empty line in the file |
|
static |
Save a binary array to a file.
|
static |
Save a binary array to a file.
|
static |
Write the FString to a file. Supports all combination of ANSI/Unicode files and platforms.
|
static |
Write the FString to a file. Supports all combination of ANSI/Unicode files and platforms.
|
inlinestrong |