Hi,
I am new to C++ and UE4 but am trying to learn as I go (tutorials, books etc) but come from procedual languages so may have a few disconnects on concepts.
I can use the following, which is well documented, to save or overwrite a file but would prefer to append in some cases.
FFileHelper::SaveStringToFile(SaveText, *(FPaths::GameDir() + OutFile))
"
Looking at the header file FileHealper.h it defines SaveStringToFile as having some more parameters.
static bool SaveStringToFile( const FString& String, const TCHAR* Filename, EEncodingOptions::Type EncodingOptions=EEncodingOptions::AutoDetect, IFileManager* FileManager=&IFileManager::Get(), uint32 WriteFlags = 0 );
EencodingOptions is defined as detailed below and I understand I need to add 0x08 for an "append" flag.
struct EEncodingOptions
{
enum Type
{
AutoDetect,
ForceAnsi,
ForceUnicode,
ForceUTF8,
ForceUTF8WithoutBOM
};
};
Unfortunately I am unclear on how to set / reference the EEncodingOptions AutoDetect type or what is required to satisfy the “IFileManager* FileManager=&IFileManager::Get()” requirements (or tell the function to use its defaults.
Any help would be most welcome.