Topic: INI File Class

Here's my little INI file class. I know that there have been functions dealing with INI data posted here already, but I figured that it's always good to have more options to choose from.
To work with a file first create an ini_file object like this:

ini_file configuration_file("my_file.ini");

To retrieve a value use the object's read method like this:

string value = configuration_file.read("my_key", "my_section");
alert("Information", "The value of my_key is " + value + ".");

To write use the write method:

configuration_file.write("my_key", "My Value", "my_section");

And finally, to delete a key from the file completely use the delete method:

configuration_file.delete("my_key", "my_section");

The section parameter is optional. If it's omitted the value of the first key specified by the first parameter will be returned. The parameters are case sensitive. Also, if the file doesn't exist, it will be created the first time you use the write method.
Enjoy!
Download