1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxFileConfig documentation
4 %% Author: Vadim Zeitlin
8 %% Copyright: (c) 2004 Vadim Zeitlin
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxFileConfig
}}\label{wxfileconfig
}
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.
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
24 \wxheading{Derived from
}
26 \helpref{wxConfigBase
}{wxconfigbase
}
28 \wxheading{Include files
}
33 \helponly{\insertatlevel{2}{\wxheading{Members
}}}
35 \membersection{wxFileConfig::wxFileConfig
}\label{wxfileconfigctor
}
37 \func{}{wxFileConfig
}{\param{wxInputStream\&
}{is
},
\param{const wxMBConv\&
}{conv = wxConvAuto()
}}
39 Read the config data from the specified stream instead of the associated file,
44 \helpref{Save
}{wxfileconfigsave
}
47 \membersection{wxFileName::GetGlobalFile
}\label{wxfilenamegetglobalfile
}
49 \func{static wxFileName
}{GetGlobalFile
}{\param{const wxString\&
}{basename
}}
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.
57 \membersection{wxFileName::GetLocalFile
}\label{wxfilenamegetlocalfile
}
59 \func{static wxFileName
}{GetLocalFile
}{\param{const wxString\&
}{basename
},
\param{int
}{style = $
0$
}}
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.
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.
69 Notice that this function cannot be used if
\arg{basename
} is already a full
73 \membersection{wxFileConfig::Save
}\label{wxfileconfigsave
}
75 \func{bool
}{Save
}{\param{wxOutputStream\&
}{os
},
\param{const wxMBConv\&
}{conv = wxConvAuto()
}}
77 Saves all config data to the given stream, returns
\true if data was saved
78 successfully or
\false on error.
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
88 \helpref{Flush
}{wxconfigbaseflush
}
91 \membersection{wxFileConfig::SetUmask
}\label{wxfileconfigsetumask
}
93 \func{void
}{SetUmask
}{\param{int
}{mode
}}
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
100 This function doesn't do anything on non-Unix platforms.
104 \helpref{wxCHANGE
\_UMASK}{wxchangeumask
}