]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/fileconf.h
Merge in from trunk r64802 - r68625
[wxWidgets.git] / interface / wx / fileconf.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: fileconf.h
e54c96f1 3// Purpose: interface of wxFileConfig
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
526954c5 6// Licence: wxWindows licence
23324ae1
FM
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxFileConfig
7c913512 11
23324ae1
FM
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
ea6a2ccb
FM
15 form @c "key = value" defining the keys and lines of special form
16 @c "[group]" indicating the start of each group.
7c913512 17
23324ae1
FM
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
20 Windows.
7c913512 21
23324ae1 22 @library{wxbase}
3c99e2fd 23 @category{cfg}
7c913512 24
e54c96f1 25 @see wxFileConfig::Save
23324ae1
FM
26*/
27class wxFileConfig : public wxConfigBase
28{
29public:
30 /**
23324ae1
FM
31 Read the config data from the specified stream instead of the associated file,
32 as usual.
3c4f71cc 33
4cc4bfaf 34 @see Save()
23324ae1 35 */
0ce6d6c8 36 wxFileConfig(wxInputStream& is, const wxMBConv& conv = wxConvAuto());
23324ae1
FM
37
38 /**
39 Return the full path to the file which would be used by wxFileConfig as global,
0ce6d6c8
FM
40 system-wide, file if it were constructed with @a basename as "global filename"
41 parameter in the constructor.
42
43 Notice that this function cannot be used if @a basename is already a full path name.
23324ae1
FM
44 */
45 static wxFileName GetGlobalFile(const wxString& basename);
46
47 /**
48 Return the full path to the file which would be used by wxFileConfig as local,
0ce6d6c8
FM
49 user-specific, file if it were constructed with @a basename as "local filename"
50 parameter in the constructor.
51
ea6a2ccb 52 @a style has the same meaning as in @ref wxConfigBase::wxConfigBase "wxConfig constructor"
23324ae1
FM
53 and can contain any combination of styles but only wxCONFIG_USE_SUBDIR bit is
54 examined by this function.
0ce6d6c8
FM
55
56 Notice that this function cannot be used if @a basename is already a full path name.
23324ae1 57 */
ea6a2ccb 58 static wxFileName GetLocalFile(const wxString& basename, int style = 0);
23324ae1
FM
59
60 /**
23324ae1
FM
61 Saves all config data to the given stream, returns @true if data was saved
62 successfully or @false on error.
0ce6d6c8
FM
63
64 Note the interaction of this function with the internal "dirty flag": the
23324ae1
FM
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
68 contents again.
3c4f71cc 69
4cc4bfaf 70 @see wxConfigBase::Flush
23324ae1 71 */
9f5737d7 72 virtual bool Save(wxOutputStream& os, const wxMBConv& conv = wxConvAuto());
23324ae1
FM
73
74 /**
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
0ce6d6c8
FM
77 some sensitive information, such as passwords), you could use @c SetUmask(0077).
78
23324ae1 79 This function doesn't do anything on non-Unix platforms.
3c4f71cc 80
e54c96f1 81 @see wxCHANGE_UMASK()
23324ae1
FM
82 */
83 void SetUmask(int mode);
84};
e54c96f1 85