]>
Commit | Line | Data |
---|---|---|
a121d720 VZ |
1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
2 | %% Name: fileconf.tex | |
3 | %% Purpose: wxFileConfig documentation | |
4 | %% Author: Vadim Zeitlin | |
5 | %% Modified by: | |
6 | %% Created: 2004-10-04 | |
7 | %% RCS-ID: $Id$ | |
8 | %% Copyright: (c) 2004 Vadim Zeitlin | |
8795498c | 9 | %% License: wxWindows license |
a121d720 VZ |
10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
11 | ||
12 | \section{\class{wxFileConfig}}\label{wxfileconfig} | |
13 | ||
14 | wxFileConfig implements \helpref{wxConfigBase}{wxconfigbase} interface for | |
15 | storing and retrieving configuration information using plain text files. The | |
16 | files have a simple format reminiscent of Windows INI files with lines of the | |
17 | form \texttt{key = value} defining the keys and lines of special form | |
18 | \texttt{$[$group$]$} indicating the start of each group. | |
19 | ||
20 | This class is used by default for wxConfig on Unix platforms but may also be | |
21 | used explicitly if you want to use files and not the registry even under | |
22 | Windows. | |
23 | ||
24 | \wxheading{Derived from} | |
25 | ||
26 | \helpref{wxConfigBase}{wxconfigbase} | |
27 | ||
28 | \wxheading{Include files} | |
29 | ||
30 | <wx/fileconf.h> | |
31 | ||
32 | ||
33 | \helponly{\insertatlevel{2}{\wxheading{Members}}} | |
34 | ||
f510b7b2 | 35 | \membersection{wxFileConfig::wxFileConfig}\label{wxfileconfigctor} |
a121d720 VZ |
36 | |
37 | \func{}{wxFileConfig}{\param{wxInputStream\& }{is}, \param{wxMBConv\& }{conv = wxConvUTF8}} | |
38 | ||
39 | Read the config data from the specified stream instead of the associated file, | |
40 | as usual. | |
41 | ||
42 | \wxheading{See also} | |
43 | ||
44 | \helpref{Save}{wxfileconfigsave} | |
45 | ||
46 | ||
466e87bd VZ |
47 | \membersection{wxFileName::GetGlobalFile}\label{wxfilenamegetglobalfile} |
48 | ||
49 | \func{static wxFileName}{GetGlobalFile}{\param{const wxString\& }{basename}} | |
50 | ||
51 | Return the full path to the file which would be used by wxFileConfig as global, | |
52 | system-wide, file if it were constructed with \arg{basename} as ``global | |
53 | filename'' parameter in the constructor. Notice that this function cannot be | |
54 | used if \arg{basename} is already a full path name. | |
55 | ||
56 | ||
57 | \membersection{wxFileName::GetLocalFile}\label{wxfilenamegetlocalfile} | |
58 | ||
59 | \func{static wxFileName}{GetLocalFile}{\param{const wxString\& }{basename}, \param{int }{style = $0$}} | |
60 | ||
61 | Return the full path to the file which would be used by wxFileConfig as local, | |
62 | user-specific, file if it were constructed with \arg{basename} as ``local | |
63 | filename'' parameter in the constructor. | |
64 | ||
65 | \arg{style} has the same meaning as in \helpref{constructor}{wxconfigbasector} | |
66 | and can contain any combination of styles but only wxCONFIG\_USE\_SUBDIR bit is | |
67 | examined by this function. | |
68 | ||
69 | Notice that this function cannot be used if \arg{basename} is already a full | |
70 | path name. | |
71 | ||
72 | ||
f510b7b2 | 73 | \membersection{wxFileConfig::Save}\label{wxfileconfigsave} |
a121d720 VZ |
74 | |
75 | \func{bool}{Save}{\param{wxOutputStream\& }{os}, \param{wxMBConv\& }{conv = wxConvUTF8}} | |
76 | ||
77 | Saves all config data to the given stream, returns \true if data was saved | |
78 | successfully or \false on error. | |
79 | ||
80 | Note the interaction of this function with the internal ``dirty flag'': the | |
81 | data is saved unconditionally, i.e. even if the object is not dirty. However | |
82 | after saving it successfully, the dirty flag is reset so no changes will be | |
83 | written back to the file this object is associated with until you change its | |
84 | contents again. | |
85 | ||
86 | \wxheading{See also} | |
87 | ||
88 | \helpref{Flush}{wxconfigbaseflush} | |
89 | ||
90 | ||
91 | \membersection{wxFileConfig::SetUmask}\label{wxfileconfigsetumask} | |
92 | ||
93 | \func{void}{SetUmask}{\param{int }{mode}} | |
94 | ||
95 | Allows to set the mode to be used for the config file creation. For example, to | |
96 | create a config file which is not readable by other users (useful if it stores | |
97 | some sensitive information, such as passwords), you could use | |
98 | {\tt SetUmask(0077)}. | |
99 | ||
100 | This function doesn't do anything on non-Unix platforms. | |
101 | ||
102 | \wxheading{See also} | |
103 | ||
104 | \helpref{wxCHANGE\_UMASK}{wxchangeumask} | |
105 | ||
106 | ||
107 |