#include <FileHelper.h>
|
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
} |
|
|
static void | BufferToString (FString &Result, const uint8 *Buffer, int32 Size) |
|
static bool | LoadFileToArray (TArray< uint8 > &Result, const TCHAR *Filename, uint32 Flags=0) |
|
static bool | LoadFileToArray (TArray64< uint8 > &Result, const TCHAR *Filename, uint32 Flags=0) |
|
static bool | LoadFileToString (FString &Result, FArchive &Reader, EHashOptions VerifyFlags=EHashOptions::None) |
|
static bool | LoadFileToString (FString &Result, const TCHAR *Filename, EHashOptions VerifyFlags=EHashOptions::None, uint32 ReadFlags=0) |
|
static bool | LoadFileToString (FString &Result, IPlatformFile *PlatformFile, const TCHAR *Filename, EHashOptions VerifyFlags=EHashOptions::None, uint32 ReadFlags=0) |
|
static bool | LoadFileToStringArray (TArray< FString > &Result, const TCHAR *Filename) |
|
static bool | LoadFileToStringArray (TArray< FString > &Result, const TCHAR *Filename, EHashOptions VerifyFlags) |
|
static bool | LoadFileToStringArrayWithPredicate (TArray< FString > &Result, const TCHAR *Filename, TFunctionRef< bool(const FString &)> Predicate) |
|
static bool | LoadFileToStringArrayWithPredicate (TArray< FString > &Result, const TCHAR *Filename, TFunctionRef< bool(const FString &)> Predicate, EHashOptions VerifyFlags) |
|
static bool | LoadFileToStringWithLineVisitor (const TCHAR *Filename, TFunctionRef< void(FStringView Line)> Visitor) |
|
static bool | SaveArrayToFile (TArrayView< const uint8 > Array, const TCHAR *Filename, IFileManager *FileManager=&IFileManager::Get(), uint32 WriteFlags=0) |
|
static bool | SaveArrayToFile (const TArray64< uint8 > &Array, const TCHAR *Filename, IFileManager *FileManager=&IFileManager::Get(), uint32 WriteFlags=0) |
|
static bool | SaveStringToFile (FStringView String, const TCHAR *Filename, EEncodingOptions EncodingOptions=EEncodingOptions::AutoDetect, IFileManager *FileManager=&IFileManager::Get(), uint32 WriteFlags=0) |
|
static bool | SaveStringArrayToFile (const TArray< FString > &Lines, const TCHAR *Filename, EEncodingOptions EncodingOptions=EEncodingOptions::AutoDetect, IFileManager *FileManager=&IFileManager::Get(), uint32 WriteFlags=0) |
|
static bool | CreateBitmap (const TCHAR *Pattern, int32 DataWidth, int32 DataHeight, const struct FColor *Data, FIntRect *SubRectangle=NULL, IFileManager *FileManager=&IFileManager::Get(), FString *OutFilename=NULL, bool bInWriteAlpha=false, EColorChannel ColorChannel=EColorChannel::All) |
|
static bool | GenerateNextBitmapFilename (const FString &Pattern, const FString &Extension, FString &OutFilename, IFileManager *FileManager=&IFileManager::Get()) |
|
static void | GenerateDateTimeBasedBitmapFilename (const FString &Pattern, const FString &Extension, FString &OutFilename) |
|
static bool | LoadANSITextFileToStrings (const TCHAR *InFilename, IFileManager *InFileManager, TArray< FString > &OutStrings) |
|
static bool | IsFilenameValidForSaving (const FString &Filename, FText &OutError) |
|
static PRAGMA_DISABLE_DEPRECATION_WARNINGS bool | CreateBitmap (const TCHAR *Pattern, int32 DataWidth, int32 DataHeight, const struct FColor *Data, FIntRect *SubRectangle, IFileManager *FileManager, FString *OutFilename, bool bInWriteAlpha, EChannelMask ChannelMask) |
|
Definition at line 27 of file FileHelper.h.
◆ EColorChannel
◆ EEncodingOptions
Enumerator |
---|
AutoDetect | |
ForceAnsi | |
ForceUnicode | |
ForceUTF8 | |
ForceUTF8WithoutBOM | |
Definition at line 38 of file FileHelper.h.
◆ EHashOptions
Enumerator |
---|
None | |
EnableVerify | Enable the async task for verifying the hash for the file being loaded
|
ErrorMissingHash | A missing hash entry should trigger an error
|
Definition at line 29 of file FileHelper.h.
◆ BufferToString()
Load a text file to an FString. Supports all combination of ANSI/Unicode files and platforms.
◆ CreateBitmap() [1/2]
◆ CreateBitmap() [2/2]
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
- Parameters
-
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). |
- Returns
- true if success
◆ GenerateDateTimeBasedBitmapFilename()
Generates the next unique bitmap filename with a specified extension
- Parameters
-
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 |
- Returns
- true if success
◆ GenerateNextBitmapFilename()
Generates the next unique bitmap filename with a specified extension
- Parameters
-
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) |
- Returns
- true if success
◆ IsFilenameValidForSaving()
Checks to see if a filename is valid for saving. A filename must be under FPlatformMisc::GetMaxPathLength() to be saved
- Parameters
-
Filename | Filename, with or without path information, to check. |
OutError | If an error occurs, this is the reason why |
◆ LoadANSITextFileToStrings()
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
- Parameters
-
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 |
- Returns
- bool true if successful, false if not
◆ LoadFileToArray() [1/2]
Load a binary file to a dynamic array with two uninitialized bytes at end as padding.
- Parameters
-
◆ LoadFileToArray() [2/2]
Load a binary file to a dynamic array with two uninitialized bytes at end as padding.
- Parameters
-
◆ LoadFileToString() [1/3]
Load a text file to an FString. Supports all combination of ANSI/Unicode files and platforms.
- Parameters
-
Result | String representation of the loaded file |
Filename | Name of the file to load |
VerifyFlags | Flags controlling the hash verification behavior ( see EHashOptions ) |
◆ LoadFileToString() [2/3]
Load a text file to an FString. Supports all combination of ANSI/Unicode files and platforms.
- Parameters
-
Result | String representation of the loaded file |
Archive | Name of the archive to load from |
VerifyFlags | Flags controlling the hash verification behavior ( see EHashOptions ) |
◆ LoadFileToString() [3/3]
Load a text file to an FString. Supports all combination of ANSI/Unicode files and platforms.
- Parameters
-
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 ) |
◆ LoadFileToStringArray() [1/2]
Load a text file to an array of strings. Supports all combination of ANSI/Unicode files and platforms.
- Parameters
-
Result | String representation of the loaded file |
Filename | Name of the file to load |
◆ LoadFileToStringArray() [2/2]
◆ LoadFileToStringArrayWithPredicate() [1/2]
Load a text file to an array of strings, filtered by a user-defined predicate. Supports all combination of ANSI/Unicode files and platforms.
- Parameters
-
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 |
◆ LoadFileToStringArrayWithPredicate() [2/2]
◆ LoadFileToStringWithLineVisitor()
Load a text file and invoke a visitor for each line. Supports all combination of ANSI/Unicode files and platforms.
- Parameters
-
Filename | Name of the file to load |
Visitor | Visitor to invoke for each non-empty line in the file |
◆ SaveArrayToFile() [1/2]
Save a binary array to a file.
◆ SaveArrayToFile() [2/2]
Save a binary array to a file.
◆ SaveStringArrayToFile()
Write the FString to a file. Supports all combination of ANSI/Unicode files and platforms.
◆ SaveStringToFile()
Write the FString to a file. Supports all combination of ANSI/Unicode files and platforms.
◆ UE_DEPRECATED()
The documentation for this struct was generated from the following file:
- C:/Users/lachl/Downloads/ArkServerAPI_NEW/ASA/AsaApi/AsaApi/Core/Public/API/UE/Misc/FileHelper.h