summaryrefslogtreecommitdiffstats
path: root/lib/inifile/iniFile.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-11 16:44:28 +0100
committermadmaxoft <github@xoft.cz>2014-01-11 16:44:28 +0100
commita332a5dc730289cca0357c7387731fd25e0b74cd (patch)
treeb09e974b93451fa192b02e6f7f65529e66f0ad3d /lib/inifile/iniFile.h
parentMerge branch 'master' into IniFileFix (diff)
downloadcuberite-a332a5dc730289cca0357c7387731fd25e0b74cd.tar
cuberite-a332a5dc730289cca0357c7387731fd25e0b74cd.tar.gz
cuberite-a332a5dc730289cca0357c7387731fd25e0b74cd.tar.bz2
cuberite-a332a5dc730289cca0357c7387731fd25e0b74cd.tar.lz
cuberite-a332a5dc730289cca0357c7387731fd25e0b74cd.tar.xz
cuberite-a332a5dc730289cca0357c7387731fd25e0b74cd.tar.zst
cuberite-a332a5dc730289cca0357c7387731fd25e0b74cd.zip
Diffstat (limited to '')
-rw-r--r--lib/inifile/iniFile.h32
1 files changed, 21 insertions, 11 deletions
diff --git a/lib/inifile/iniFile.h b/lib/inifile/iniFile.h
index 83d961fc6..40af618dc 100644
--- a/lib/inifile/iniFile.h
+++ b/lib/inifile/iniFile.h
@@ -35,7 +35,7 @@
class cIniFile
{
private:
- bool m_IsCaseInsensitive;
+ bool m_IsCaseInsensitive;
struct key
{
@@ -122,22 +122,32 @@ public:
return (GetValueSetI(keyname, valuename, defValue ? 1 : 0) != 0);
}
- // Sets value of [keyname] valuename =.
- // Specify the optional paramter as false (0) if you do not want it to create
- // the key if it doesn't exist. Returns true if data entered, false otherwise.
+ // Adds a new value to the specified key.
+ // If a value of the same name already exists, creates another one (non-standard INI file)
+ void AddValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value);
+ void AddValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value);
+ void AddValueB(const AString & a_KeyName, const AString & a_ValueName, const bool a_Value)
+ {
+ return AddValueI(a_KeyName, a_ValueName, a_Value ? 1 : 0);
+ }
+ void AddValueF(const AString & a_KeyName, const AString & a_ValueName, const double a_Value);
+
+ // Overwrites the value of [keyname].valuename
+ // Specify the optional parameter as false (0) if you do not want the value created if it doesn't exist.
+ // Returns true if value set, false otherwise.
// Overloaded to accept string, int, and double.
- bool SetValue( const int keyID, const int valueID, const AString & value);
- bool SetValue( const AString & keyname, const AString & valuename, const AString & value, const bool create = true);
- bool SetValueI( const AString & keyname, const AString & valuename, const int value, const bool create = true);
- bool SetValueB( const AString & keyname, const AString & valuename, const bool value, const bool create = true)
+ bool SetValue (const int keyID, const int valueID, const AString & value);
+ bool SetValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value, const bool a_CreateIfNotExists = true);
+ bool SetValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value, const bool a_CreateIfNotExists = true);
+ bool SetValueB(const AString & a_KeyName, const AString & a_ValueName, const bool a_Value, const bool a_CreateIfNotExists = true)
{
- return SetValueI( keyname, valuename, int(value), create);
+ return SetValueI(a_KeyName, a_ValueName, int(a_Value), a_CreateIfNotExists);
}
- bool SetValueF( const AString & keyname, const AString & valuename, const double value, const bool create = true);
+ bool SetValueF(const AString & a_KeyName, const AString & a_ValueName, const double a_Value, const bool a_CreateIfNotExists = true);
// tolua_end
- bool SetValueV( const AString & keyname, const AString & valuename, char *format, ...);
+ bool SetValueV( const AString & a_KeyName, const AString & a_ValueName, const char * a_Format, ...);
// tolua_begin