11/22/2020
FFileHelper
FFileHelper 是一个API,提供对外部文件操作的接口,在UE4的\Engine\Source\Runtime\Core\Public\Misc目录中。首先明确这是一个静态库。
函数接口
/**
* Load a text file to an FString. Supports all combination of ANSI/Unicode files and platforms.
*
* @param Result String representation of the loaded file
* @param Filename Name of the file to load
* @param VerifyFlags Flags controlling the hash verification behavior ( see EHashOptions )
*/
static bool LoadFileToString( FString& Result, const TCHAR* Filename, EHashOptions VerifyFlags = EHashOptions::None, uint32 ReadFlags = 0 );
/**
* Write the FString to a file.
* Supports all combination of ANSI/Unicode files and platforms.
*/
static bool SaveStringToFile( const FString& String, const TCHAR* Filename, EEncodingOptions EncodingOptions = EEncodingOptions::AutoDetect, IFileManager* FileManager = &IFileManager::Get(), uint32 WriteFlags = 0 );
/**
* Saves a 24/32Bit BMP file to disk
*
* @param 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")
* @param DataWidth - Width of the bitmap supplied in Data >0
* @param DataHeight - Height of the bitmap supplied in Data >0
* @param Data must not be 0
* @param SubRectangle optional, specifies a sub-rectangle of the source image to save out. If NULL, the whole bitmap is saved
* @param FileManager mus