1 #ifndef _WX_MLBASE_XMLCONF_H_ 2 #define _WX_MLBASE_XMLCONF_H_ 15 #include <wx/textfile.h> 16 #include <wx/confbase.h> 17 #include <wx/xml/xml.h> 19 #include <wx/stream.h> 31 #define wxXmlConfigEntry wxXmlNode 32 #define wxXmlConfigGroup wxXmlNode 38 wxXmlConfig(
const wxString& appName = wxEmptyString,
39 const wxString& vendorName = wxEmptyString,
40 const wxString& localFilename = wxEmptyString,
41 const wxString& globalFilename = wxEmptyString,
42 long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE,
43 const wxMBConv& conv = wxConvAuto());
45 wxXmlConfig( wxInputStream& inStream,
const wxMBConv& conv = wxConvAuto() );
49 static wxString GetGlobalFileName(
const wxChar *szFile );
50 static wxString GetLocalFileName(
const wxChar *szFile );
52 virtual void SetPath(
const wxString& strPath );
53 virtual const wxString&
GetPath()
const {
return m_strPath; }
55 virtual bool GetFirstGroup( wxString& str,
long& lIndex )
const;
56 virtual bool GetNextGroup( wxString& str,
long& lIndex )
const;
57 virtual bool GetFirstEntry( wxString& str,
long& lIndex )
const;
58 virtual bool GetNextEntry( wxString& str,
long& lIndex )
const;
60 virtual size_t GetNumberOfEntries(
bool bRecursive =
false )
const;
61 virtual size_t GetNumberOfGroups(
bool bRecursive =
false )
const;
63 virtual bool HasGroup(
const wxString& strName )
const;
64 virtual bool HasEntry(
const wxString& strName )
const;
66 virtual bool Flush(
bool bCurrentOnly =
false );
68 virtual bool RenameEntry(
const wxString& oldName,
const wxString& newName );
69 virtual bool RenameGroup(
const wxString& oldName,
const wxString& newName );
71 virtual bool DeleteEntry(
const wxString& key,
bool bGroupIfEmptyAlso =
true );
72 virtual bool DeleteGroup(
const wxString& key );
73 virtual bool DeleteAll();
76 virtual bool Save( wxOutputStream& os,
const wxMBConv& conv = wxConvAuto() );
80 virtual bool DoReadString(
const wxString& key, wxString* pStr )
const;
81 virtual bool DoReadLong(
const wxString& key,
long* pl )
const;
83 virtual bool DoWriteString(
const wxString& key,
const wxString& szValue );
84 virtual bool DoWriteLong(
const wxString& key,
long lValue );
85 #if wxCHECK_VERSION(2,9,0) && wxUSE_BASE64 86 virtual bool DoReadBinary(
const wxString& key, wxMemoryBuffer* buf )
const;
87 virtual bool DoWriteBinary(
const wxString& key,
const wxMemoryBuffer& buf );
90 static wxString GetGlobalDir();
91 static wxString GetLocalDir();
97 void Parse(
const wxXmlDocument& xmlDocument,
bool bLocal );
101 bool DoSetPath(
const wxString& strPath,
bool createMissingComponents );
126 #endif//_WX_MLBASE_XMLCONF_H_
#define WXDLLIMPEXP_MLBASE
virtual const wxString & GetPath() const
wxXmlConfigGroup * m_pCurrentGroup