X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;ds=inline;f=src%2Flibs%2FCommon%2Finifile.h;h=21a1bc4346ac293b8d96b03992242210efce013a;hb=b280102618ec2ced838a092ba7673964ab272569;hp=b795e6a9435dc02dfc222c7af964094b93649801;hpb=6230ebd0a05134031e52001c15473c3c3e6c7c1b;p=evaf
diff --git a/src/libs/Common/inifile.h b/src/libs/Common/inifile.h
index b795e6a..21a1bc4 100644
--- a/src/libs/Common/inifile.h
+++ b/src/libs/Common/inifile.h
@@ -35,18 +35,31 @@ namespace Internal {
/**
* Class for reading and writing parameter values in INI files.
*
- * The IniFile class provides access to parameter values in a standard INI file. Every parameter value is
- * identified by a section/key name pair. Key names can be prefixed with 'windows:' or 'linux:' if the
- * parameter value is specific for the given platform. This allows entering platform-specific parameter
- * values to the INI file. INI files can contain comment lines that start with ';' or '#'. Comments are
+ * The IniFile class provides access to parameter values in a standard INI file.
+ * Every parameter value is identified by a section/key name pair. Key names can be prefixed with
+ * 'windows:' or 'linux:' if the parameter value is specific for the given platform.
+ * This allows entering platform-specific parameter values to the INI file.
+ *
+ * INI files can contain comment lines that start with ';' or '#'. Comments are
* preserved when new values are written to the INI file.
*
+ * This is a sample INI %file:
+ * @code
+ * [main]
+ * # The full name of this parameter is 'main/name'
+ * name = MyApplication
+ *
+ * [extensions/about]
+ * # The full name of this parameter is 'extensions/about/module'
+ * module = libabout.so
+ * @endcode
+ *
* Values in INI files are stored as strings and the IniFile class expects them to use specific formats if
* the returned value is supposed to be of a different data type. The following list shows the expected format
* of different data types:
*
* @li Bool - '0', 'false', 'off', 'no' are equal to false and '1', 'true', 'on', 'yes' are equal to true;
- * @li Char - a single character or an ASCII code as '\0NNN' or '\0xNN';
+ * @li Char - a single character or an ASCII code as '\0NNN' (oct) or '\0xNN' (hex);
* @li Date - date string in the ISO 8601 format YYYY-MM-DD;
* @li DateTime - date and time string in the ISO 8601 format YYY-MM-DDTHH:MM:SSTZD;
* @li Double - the decimal point is always '.' regardless of the locale;
@@ -92,7 +105,7 @@ public:
* @return The value from the INI file or an invalid QVariant if failed
*
* The getValue() method reads a parameter value from the INI file. Parameters are identified by a section and key name pair
- * in the format '<section>/<key>'. For example, if the section is called 'general' and the key is called 'log_level',
+ * in the format '\/\'. For example, if the section is called 'general' and the key is called 'log_level',
* then the name of the parameter should be given as 'general/log_level'. Parameter names are case insensitive.
*
* If the parameter cannot be read because it is not found in the INI file or the INI file object is invalid, returns the
@@ -103,6 +116,8 @@ public:
* @li If the value in the INI file is 'abc' and the default value an integer value, then validation
* fails and the method returns the default value;
* @li If the default value is a boolean value, then the method accepts '1', 'true', 'on' and 'yes' as valid values.
+ *
+ * @sa eVaf::Common::toVariant()
*/
QVariant getValue(QString const & paramName, QVariant const & defaultValue = QVariant::Invalid);
@@ -113,7 +128,7 @@ public:
* @return True if succeeded and false if not
*
* The setValue() method writes a parameter value to the INI file. Parameters are identified by a section and key name pair
- * in the format '<section>/<key>'. For example, if the section is called 'general' and the key is called 'log_level',
+ * in the format '\/\'. For example, if the section is called 'general' and the key is called 'log_level',
* the the name of the parameter should be given as 'general/log_level'. Parameter names are case insensitive.
*
* The method returns true if the parameter value was written into the INI file and false if not. Use the errorString() method