contents up previous next

wxfileconfig

wxfileconfig implements wxconfigbase interface for storing and retrieving configuration information using plain text files. the files have a simple format reminiscent of windows ini files with lines of the form key = value defining the keys and lines of special form [group] indicating the start of each group.

this class is used by default for wxconfig on unix platforms but may also be used explicitly if you want to use files and not the registry even under windows.

derived from

wxconfigbase

include files

<wx/fileconf.h>

wxfileconfig::wxfileconfig
wxfileconfig::save
wxfileconfig::setumask


wxfileconfig::wxfileconfig

wxfileconfig(wxinputstream& is, wxmbconv& conv = wxconvutf8)

read the config data from the specified stream instead of the associated file, as usual.

see also

save


wxfileconfig::save

bool save(wxoutputstream& os, wxmbconv& conv = wxconvutf8)

saves all config data to the given stream, returns true if data was saved successfully or false on error.

note the interaction of this function with the internal "dirty flag'': the data is saved unconditionally, i.e. even if the object is not dirty. however after saving it successfully, the dirty flag is reset so no changes will be written back to the file this object is associated with until you change its contents again.

see also

flush


wxfileconfig::setumask

void setumask(int mode)

allows to set the mode to be used for the config file creation. for example, to create a config file which is not readable by other users (useful if it stores some sensitive information, such as passwords), you could use setumask(0077).

this function doesn't do anything on non-unix platforms.

see also

wxchange_umask