1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/palmos/prefconf.h
3 // Purpose: wxPrefConfig interface
4 // Author: Wlodzimierz ABX Skiba
8 // Copyright: (c) Wlodzimierz Skiba
9 // License: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "prefconf.h"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
23 class WXDLLIMPEXP_BASE wxPrefConfig
: public wxConfigBase
27 wxPrefConfig(const wxString
& appName
= wxEmptyString
,
28 const wxString
& vendorName
= wxEmptyString
,
29 const wxString
& localFilename
= wxEmptyString
,
30 const wxString
& globalFilename
= wxEmptyString
,
31 long style
= wxCONFIG_USE_GLOBAL_FILE
);
33 // dtor will save unsaved data
34 virtual ~wxPrefConfig(){}
36 // implement inherited pure virtual functions
37 // ------------------------------------------
40 virtual void SetPath(const wxString
& strPath
);
41 virtual const wxString
& GetPath() const { return m_strPath
; }
43 // entry/subgroup info
44 virtual bool GetFirstGroup(wxString
& str
, long& lIndex
) const;
45 virtual bool GetNextGroup (wxString
& str
, long& lIndex
) const;
46 virtual bool GetFirstEntry(wxString
& str
, long& lIndex
) const;
47 virtual bool GetNextEntry (wxString
& str
, long& lIndex
) const;
49 // tests for existence
50 virtual bool HasGroup(const wxString
& strName
) const;
51 virtual bool HasEntry(const wxString
& strName
) const;
52 virtual EntryType
GetEntryType(const wxString
& name
) const;
54 // get number of entries/subgroups in the current group, with or without
56 virtual size_t GetNumberOfEntries(bool bRecursive
= false) const;
57 virtual size_t GetNumberOfGroups(bool bRecursive
= false) const;
59 virtual bool Flush(bool WXUNUSED(bCurrentOnly
) = false) { return true; }
62 virtual bool RenameEntry(const wxString
& oldName
, const wxString
& newName
);
63 virtual bool RenameGroup(const wxString
& oldName
, const wxString
& newName
);
66 virtual bool DeleteEntry(const wxString
& key
, bool bGroupIfEmptyAlso
= true);
67 virtual bool DeleteGroup(const wxString
& key
);
68 virtual bool DeleteAll();
71 // implement read/write methods
72 virtual bool DoReadString(const wxString
& key
, wxString
*pStr
) const;
73 virtual bool DoReadLong(const wxString
& key
, long *plResult
) const;
75 virtual bool DoWriteString(const wxString
& key
, const wxString
& szValue
);
76 virtual bool DoWriteLong(const wxString
& key
, long lValue
);
79 // no copy ctor/assignment operator
80 wxPrefConfig(const wxPrefConfig
&);
81 wxPrefConfig
& operator=(const wxPrefConfig
&);
83 // current path (not '/' terminated)
86 // current path (group) content (cache for read/write)
89 // current group modified ?
93 #endif // _PREFCONF_H_