How to read and write a data structure in a flat file?.

I want to make a small code to select my development credentials for EOS. Because it’s a headache not to do this automatically.

So all I need is to know how to read and write a data structure to a file.

Basically what I want to do is this:
Something extremely simple that would make everything much easier.



3

The problem is that I’ve been reading the documentation and various posts on this forum and I can’t find any function or library that allows me to read and write a data structure in a file.

For example:
https://docs.unrealengine.com/4.27/en-US/API/Runtime/Core/Misc/FFileHelper/

Or

or

or

Is there any way to do this?

Thank you very much!!

Hi Ivan3z,

Just make “ToString” and “FromString” functions in your structure and save using something like the FPlatformFileManager.

Those are just wrappers to allow file IO on all platforms - if you’re just using windows or another OS you can of course just write your own routines using that platforms IO routines (eg iostream).

1 Like

Hi
That’s great to be able to use standard C++.
I thought that could cause problems.
This has happened to me using some libraries.

The code is just to help while I program the epic online services.
After that the code will not be necessary.
So I think the wrapper will not be necessary in this case.

Thank you very much for your help!!
Now I know what to do next time I have a similar problem!!
Very appreciated!! :heart:

2 Likes