]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/fileconf.h
   1 ///////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     interface of wxFileConfig 
   4 // Author:      wxWidgets team 
   6 // Licence:     wxWindows license 
   7 ///////////////////////////////////////////////////////////////////////////// 
  12     wxFileConfig implements wxConfigBase interface for 
  13     storing and retrieving configuration information using plain text files. The 
  14     files have a simple format reminiscent of Windows INI files with lines of the 
  15     form @c "key = value" defining the keys and lines of special form 
  16     @c "[group]" indicating the start of each group. 
  18     This class is used by default for wxConfig on Unix platforms but may also be 
  19     used explicitly if you want to use files and not the registry even under 
  25     @see wxFileConfig::Save 
  27 class wxFileConfig 
: public wxConfigBase
 
  31         Read the config data from the specified stream instead of the associated file, 
  36     wxFileConfig(wxInputStream
& is
, const wxMBConv
& conv 
= wxConvAuto()); 
  39         Return the full path to the file which would be used by wxFileConfig as global, 
  40         system-wide, file if it were constructed with @a basename as "global filename" 
  41         parameter in the constructor. 
  43         Notice that this function cannot be used if @a basename is already a full path name. 
  45     static wxFileName 
GetGlobalFile(const wxString
& basename
); 
  48         Return the full path to the file which would be used by wxFileConfig as local, 
  49         user-specific, file if it were constructed with @a basename as "local filename" 
  50         parameter in the constructor. 
  52         @a style has the same meaning as in @ref wxConfigBase::wxConfigBase "wxConfig constructor" 
  53         and can contain any combination of styles but only wxCONFIG_USE_SUBDIR bit is 
  54         examined by this function. 
  56         Notice that this function cannot be used if @a basename is already a full path name. 
  58     static wxFileName 
GetLocalFile(const wxString
& basename
, int style 
= 0); 
  61         Saves all config data to the given stream, returns @true if data was saved 
  62         successfully or @false on error. 
  64         Note the interaction of this function with the internal "dirty flag": the 
  65         data is saved unconditionally, i.e. even if the object is not dirty. However 
  66         after saving it successfully, the dirty flag is reset so no changes will be 
  67         written back to the file this object is associated with until you change its 
  70         @see wxConfigBase::Flush 
  72     virtual bool Save(wxOutputStream
& os
, const wxMBConv
& conv 
= wxConvAuto()); 
  75         Allows to set the mode to be used for the config file creation. For example, to 
  76         create a config file which is not readable by other users (useful if it stores 
  77         some sensitive information, such as passwords), you could use @c SetUmask(0077). 
  79         This function doesn't do anything on non-Unix platforms. 
  83     void SetUmask(int mode
);