Logo Search packages:      
Sourcecode: qsstv version File versions  Download package

configurationFile Class Reference

#include <configfile.h>

List of all members.


Detailed Description

Saves and Restores program configuration
Author:
johan maes - on4qz
Modules to support config files
Features:
Users can edit and comment the config files. This functions will leave the comment strings intact and only update the values. The configfile will first be searched in the HOME directory, then in the local directory Text after '#' is seen as a comment.
layout: Optionname = Optionvalue [# comment]
Maximum length (including comment): 255 characters

Use:

  1. Register the Options to be used
    RegisterOption(const char *OptionName,const char *OptionValue);
  2. Read the configfile
    ReadFile(const char *name, const char *path="") only options that are registered will be used and updated
  3. SaveFile
    Will save the Options in the same file that was indicated in the ReadFile. Options that are registered but that are not in the configfile, are added. Options in the configfile that are not registered are flagged as invalid (commented out).
    See also:
    configOption

Definition at line 120 of file configfile.h.


Public Member Functions

bool hasChanged ()
void initOptions (sConfigEntry *tableconst, const char *name=0, const char *path=0)
bool readFile (const char *name, const char *path=NULL, bool create=FALSE)
const char * readOption (const char *)
bool readOption (const char *s, int *i, int &size)
bool readOption (const char *s, bool &b)
bool readOption (const char *s, double &i)
bool readOption (const char *s, float &i)
bool readOption (const char *s, short int &i)
bool readOption (const char *s, int &i)
void registerOption (const char *OptionName, const char *OptionValue)
bool saveFile (sConfigEntry *table)
void setConfigFilename (const char *t)
void setOption (const char *s, int *i, int &size)
void setOption (const char *s, bool b)
void setOption (const char *s, double t)
void setOption (const char *s, float t)
void setOption (const char *s, short int t)
void setOption (const char *s, int t)
void setOption (const char *s, const char *t)

Private Member Functions

configOptionoptionCheck (QString OptN, QString OptV, bool Update)
int processLine (QString &s, QString &OptN, QString &OptV)
void saveActiveOptions (sConfigEntry *table)

Private Attributes

bool changed
QDir configDir
QFileInfo configFileName
QList< configOptionoptionList

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index