====== cIniFile ======
The cIniFile is a class that makes it simple to read from and write to INI files. MCServer uses mostly INI files for settings and options.

===== Practical usage =====
If you want to use cIniFile you need to know a couple of things; what is the key name and what is the value name. Below is a demonstration of what is what.
<code ini>
[KeyName]
ValueName=Value
ValueName=Value

[KeyName]
ValueName=Value
</code>

cIniFile is very easy to use. For example, you can find out what port the server is supposed to use according to settings.ini by using this little snippet.
<code lua>local IniFile = cIniFile("settings.ini")
if ( IniFile:ReadFile() == true ) then
	ServerPort = IniFile:GetValueI("Server", "Port" )
end</code>

cIniFile has different versions of ''GetValue()'' for getting booleans, integers, doubles and strings. In Lua however you probably only need the string version, the default ''GetValue()'' because Lua automagically converts between types.

===== Class definition =====
^ Function ^ Return type ^
| cIniFile( String IniPath ) | [[cIniFile]] |
|  |  |
| CaseSensitive() | void |
| CaseInsensitive() | void |
|  |  |
| Path( String NewPath  ) | void |
| Path() | String |
| SetPath( String NewPath ) | void |
|  |  |
| ReadFile() | bool |
| WriteFile() | bool |
| Erase() | void |
| Clear() | void |
| Reset() | void |
|  |  |
| FindKey( String Keyname ) | long int | 
| FindValue( unsigned int KeyID, String Valuename ) | long int | 
| NumKeys() | unsigned int | 
| GetNumKeys() | unsigned int | 
| AddKeyName( String Keyname ) | unsigned int |
| KeyName( unsigned int KeyID ) | String | 
| GetKeyName( unsigned int KeyID ) | String | 
| NumValues( unsigned int KeyID ) | unsigned int |
| GetNumValues( unsigned int KeyID ) | unsigned int |
| NumValues( String Keyname ) | unsigned int |
| GetNumValues( String Keyname ) | unsigned int |
| ValueName( unsigned KeyID, unsigned ValueID ) | String | 
| GetValueName( unsigned KeyID, unsigned ValueID ) | String | 
| ValueName( String Keyname, unsigned ValueID ) | String | 
| GetValueName( String Keyname, unsigned ValueID ) | String | 
|  |  |
| GetValue( unsigned KeyID, unsigned ValueID, String defValue = "" ) | String | 
| GetValue( String Keyname, String Valuename, String defValue = "" ) | String | 
| GetValueI( String Keyname, String Valuename, int defValue = 0 ) | int | 
| GetValueB( String Keyname, String Valuename, bool defValue = false ) | bool | 
| GetValueF( String Keyname, String Valuename, double defValue = 0.0 ) | double | 
|  |  |
| GetValueSet( String Keyname, String Valuename, String defValue = "" ) | String | 
| GetValueSetI( String Keyname, String Valuename, int defValue = 0 ) | int | 
| GetValueSetB( String Keyname, String Valuename, bool defValue = false ) | bool | 
| GetValueSetF( String Keyname, String Valuename, double defValue = 0.0 ) | double | 
|  |  |
| SetValue( unsigned KeyID, unsigned ValueID, String Value ) | bool |
| SetValue( String Keyname, String Valuename, String Value, bool Create = true ) | bool |
| SetValueI( String Keyname, String Valuename, int Value, bool Create = true ) | bool |
| SetValueB( String Keyname, String Valuename, bool Value, bool Create = true ) | bool |
| SetValueF( String Keyname, String Valuename, double Value, bool Create = true ) | bool |
|  |  |
| DeleteValueByID( unsigned KeyID, unsigned ValueID ) | bool |
| DeleteValue( String Keyname, String Valuename ) | bool |
| DeleteKey(String Keyname ) | bool |
|  |  |
| NumHeaderComments() | unsigned int |
| HeaderComment( String Comment ) | void |
| HeaderComment( unsigned CommentID ) | String | 
| DeleteHeaderComment( unsigned CommentID ) | bool |
| DeleteHeaderComments() | void |
|  |  |
| NumKeyComments( unsigned KeyID ) | unsigned int | 
| NumKeyComments( String Keyname ) | unsigned int | 
| KeyComment( unsigned KeyID, String Comment ) | bool |
| KeyComment( String Keyname, String Comment ) | bool |
| KeyComment( unsigned KeyID, unsigned CommentID ) | String | 
| KeyComment( String Keyname, unsigned CommentID ) | String | 
| DeleteKeyComment( unsigned KeyID, unsigned CommentID ) | bool |
| DeleteKeyComment( String Keyname, unsigned CommentID ) | bool |
| DeleteKeyComments( unsigned KeyID ) | bool |
| DeleteKeyComments( String Keyname ) | bool |

===== Functions =====
==== cIniFile() ====
Constructor. Will return ''cIniFile'' instance with a link to a given ''.ini'' filename.
==== CaseSensitive() and CaseInsensitive() ====
Turn on/off case sensetivity for ''cIniFile''.
==== Path() and SetPath() ====
Given a string, will set path to an ''.ini'' file. Path() without any arguments will return current ''.ini'' path.
==== ReadFile(), WriteFile() and Erase(), Clear(), Reset() ====
ReadFile() will read whole ''.ini'' file and load it into RAM, WriteFile() will write all changes made to values to ''.ini'' file. Erase(), Clear() and Reset() are all same and will delete all stored in ''.ini'' data.
==== FindKey(), FindValue() ====
Returns Key and Value ID's, or ''noID'' constant (-1) if key/value wasn't found.
==== NumKeys(), GetNumKeys() and NumValues(), GetNumValues() ====
Returns total ammount of keys or values stored for specified (by name or ID) key in ''cIniFile''.
==== AddKeyName() ====
Adds a key name.
==== KeyName() and GetKeyName() ====
Returns key names by index.
==== ValueName() and GetValueName() ====
Returns value name by index for a given ''Keyname'' or ''KeyID''.
==== GetValue(), GetValueI(), GetValueB() and GetValueF() ====
Gets value of ''[Keyname]'' valuename. Returns ''defValue'' if key/value not found.
==== GetValueSet(), GetValueSetI(), GetValueSetB() and GetValueSetF() ====
Gets value of ''[Keyname]'' valuename, if key/value not found - write the ''defValue'' to the INI file.
==== SetValue(), SetValueI(), SetValueB() and SetValueF() ====
Sets value of ''[Keyname]'' valuename. Specify the optional paramter as ''false'' (0) if you don't want it to create the key if it doesn't exist. Returns ''true'' if data entered, ''false'' otherwise.
==== DeleteKey(), DeleteValue() and DeleteValueByID() ====
Deletes specified key with all values contained within; deletes specified value.
==== NumHeaderComments() and HeaderComment() ====
Returns number of header comments. ''HeaderComment()'' given a string will add new header comment, given a ''commentID'' will return header comment content.
==== DeleteHeaderComment() and DeleteHeaderComments() ====
Deletes given/all comment(s).
==== NumKeyComments(), KeyComment(), DeleteKeyComment() and DeleteKeyComments() ====
Key comment functions. Key comments are those comments within a key. Any comments defined within value names will be added to this list. Therefore, these comments will be moved to the top of the key definition when the ''cIniFile::WriteFile()'' is called.
''NumKeyComments()'' will return overall number of keycomments for given key, ''KeyComment()'' will add (''string'')/return (''commentID'') keycomment, ''DeleteKeyComment()'' will delete given keycomment, ''DeleteKeyComments()'' will delete all of them.