@Rookfighter Thank you for this useful library.
I noticed that after updating the values and calling save option, all the comments and empty lines in the ini file gets removed.
Since most of these files are edited manually by users, retaining comments and white spaces are essential while saving.
Sample ini file
# Send a message to the world
[world]
message=Hello
# Just foo :)
[foo]
f1=123
Sample code
#include <inicpp.h>
int main()
{
ini::IniFile myIni;
myIni.load("some/ini/path");
myIni["world"]["message"] = "Hello world";
myIni.save("some/ini/path");
}
Result after saving the file
[world]
message=Hello world
[foo]
f1=123
Do let me know if there is already an option to avoid them being removed.
@Rookfighter Thank you for this useful library.
I noticed that after updating the values and calling
saveoption, all the comments and empty lines in the ini file gets removed.Since most of these files are edited manually by users, retaining comments and white spaces are essential while saving.
Sample ini file
Sample code
Result after saving the file
Do let me know if there is already an option to avoid them being removed.