Using FConfigCacheIni

I’m trying to read and write .ini files in my game, and I found this class which has the function


    void LoadFile
     (
         const FString & InFilename,
         const FConfigFile * Fallback,
         const TCHAR * PlatformString
     )

and some other functions can also load ini files. But I just can’t figure out what the parameters should be, especially InFileName. For example, if I want to load an .ini file: “myproject/folder/file.ini”, how should I pass the parameter?

Thanks in advance!

If you search in the code for “FConfigCacheIni::LoadExternalIniFile” you’ll find plenty of examples of how to load an INI file. The Filepath can be relative to the Engine or Game directories, so you have a wide array of options.

Thank you so much, however I figured out my problem is that I shouldn’t give filename an “.ini” extension, since the function expects it to be an “.ini” file.