]> vaikene.ee Git - evaf/blobdiff - src/libs/Common/inifile_p.h
Changed the Common::IniFile class to work with 7-bit character INI files only.
[evaf] / src / libs / Common / inifile_p.h
index b7826270f25239bc64c0013f0949d7c031ee54cc..ffb7a1e2647d7031421ecf004c904639533de456 100644 (file)
@@ -57,12 +57,17 @@ public:
     /**
      * Key name of the parameter
      */
-    QString name;
+    QByteArray name;
 
     /**
      * Value from the INI file
      */
-    QString paramValue;
+    QByteArray paramValue;
+
+    /**
+     * Value converted to the final type (defaults to QVariant::Invalid
+     */
+    QVariant value;
 
     /**
      * Flag indicating that this value is valid on this OS only
@@ -93,14 +98,14 @@ public:
     /**
      * Name of the section
      */
-    QString name;
+    QByteArray name;
 
     /**
      * List of all the known parameter values in this section
      *
      * The key to the hash table is the name of the key for the parameters value.
      */
-    QHash<QString, QExplicitlySharedDataPointer<IniFileValue> > values;
+    QHash<QByteArray, QExplicitlySharedDataPointer<IniFileValue> > values;
 
 };
 
@@ -115,9 +120,9 @@ public:
 
     ~IniFileImpl();
 
-    QVariant getValue(QString const & paramName, QVariant const & defaultValue);
+    QVariant getValue(QByteArray const & paramName, QVariant const & defaultValue);
 
-    bool setValue(QString const & paramName, QVariant const & value);
+    bool setValue(QByteArray const & paramName, QVariant const & value);
 
     inline bool isValid() const { return mValid; }
 
@@ -145,7 +150,7 @@ private: // Members
      *
      * The key to the hash table is the name of the section.
      */
-    QHash<QString, QExplicitlySharedDataPointer<IniFileSection> > mCache;
+    QHash<QByteArray, QExplicitlySharedDataPointer<IniFileSection> > mCache;
 
     /// When was the INI file modified.
     QDateTime mLastModified;
@@ -178,7 +183,7 @@ private: /// Methods
      * The file object is expected to be opened if the mValid flag is true. If the mValid flag is false, looks
      * only in the cache.
      */
-    QExplicitlySharedDataPointer<IniFileSection> getSection(QFile & file, QString const & sectionName);
+    QExplicitlySharedDataPointer<IniFileSection> getSection(QFile & file, QByteArray const & sectionName);
 
     /**
      * Looks for a parameter in the INI file
@@ -195,7 +200,7 @@ private: /// Methods
      * The file object is expected to be opened if the mValid flag is true. If the mValid flag is false, looks
      * only in the cache.
      */
-    QExplicitlySharedDataPointer<IniFileValue> getParameter(QFile & file, IniFileSection & section, QString const & paramName);
+    QExplicitlySharedDataPointer<IniFileValue> getParameter(QFile & file, IniFileSection & section, QByteArray const & paramName);
 
 };