]> git.saurik.com Git - wxWidgets.git/blame - include/wx/palmos/prefconf.h
[ 1473731 ] 'wxColourBase and wxString <-> wxColour implementation' with minor modifi...
[wxWidgets.git] / include / wx / palmos / prefconf.h
CommitLineData
ffecfa5a 1///////////////////////////////////////////////////////////////////////////////
23a59c2c
WS
2// Name: wx/palmos/prefconf.h
3// Purpose: wxPrefConfig interface
4// Author: Wlodzimierz ABX Skiba
ffecfa5a 5// Modified by:
23a59c2c
WS
6// Created: 28.12.2004
7// RCS-ID: $Id$
8// Copyright: (c) Wlodzimierz Skiba
9// License: wxWindows licence
ffecfa5a
JS
10///////////////////////////////////////////////////////////////////////////////
11
23a59c2c
WS
12#ifndef _PREFCONF_H_
13#define _PREFCONF_H_
ffecfa5a 14
ffecfa5a 15// ----------------------------------------------------------------------------
23a59c2c 16// wxPrefConfig
ffecfa5a
JS
17// ----------------------------------------------------------------------------
18
23a59c2c 19class WXDLLIMPEXP_BASE wxPrefConfig : public wxConfigBase
ffecfa5a
JS
20{
21public:
22 // ctor & dtor
23a59c2c
WS
23 wxPrefConfig(const wxString& appName = wxEmptyString,
24 const wxString& vendorName = wxEmptyString,
25 const wxString& localFilename = wxEmptyString,
26 const wxString& globalFilename = wxEmptyString,
27 long style = wxCONFIG_USE_GLOBAL_FILE);
ffecfa5a 28
23a59c2c
WS
29 // dtor will save unsaved data
30 virtual ~wxPrefConfig(){}
ffecfa5a
JS
31
32 // implement inherited pure virtual functions
33 // ------------------------------------------
34
35 // path management
36 virtual void SetPath(const wxString& strPath);
37 virtual const wxString& GetPath() const { return m_strPath; }
38
39 // entry/subgroup info
ffecfa5a
JS
40 virtual bool GetFirstGroup(wxString& str, long& lIndex) const;
41 virtual bool GetNextGroup (wxString& str, long& lIndex) const;
42 virtual bool GetFirstEntry(wxString& str, long& lIndex) const;
43 virtual bool GetNextEntry (wxString& str, long& lIndex) const;
44
23a59c2c 45 // tests for existence
ffecfa5a
JS
46 virtual bool HasGroup(const wxString& strName) const;
47 virtual bool HasEntry(const wxString& strName) const;
48 virtual EntryType GetEntryType(const wxString& name) const;
49
23a59c2c
WS
50 // get number of entries/subgroups in the current group, with or without
51 // it's subgroups
52 virtual size_t GetNumberOfEntries(bool bRecursive = false) const;
53 virtual size_t GetNumberOfGroups(bool bRecursive = false) const;
ffecfa5a 54
23a59c2c 55 virtual bool Flush(bool WXUNUSED(bCurrentOnly) = false) { return true; }
ffecfa5a
JS
56
57 // rename
58 virtual bool RenameEntry(const wxString& oldName, const wxString& newName);
59 virtual bool RenameGroup(const wxString& oldName, const wxString& newName);
60
61 // delete
23a59c2c 62 virtual bool DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso = true);
ffecfa5a
JS
63 virtual bool DeleteGroup(const wxString& key);
64 virtual bool DeleteAll();
65
66protected:
ffecfa5a
JS
67 // implement read/write methods
68 virtual bool DoReadString(const wxString& key, wxString *pStr) const;
69 virtual bool DoReadLong(const wxString& key, long *plResult) const;
70
71 virtual bool DoWriteString(const wxString& key, const wxString& szValue);
72 virtual bool DoWriteLong(const wxString& key, long lValue);
73
74private:
75 // no copy ctor/assignment operator
23a59c2c
WS
76 wxPrefConfig(const wxPrefConfig&);
77 wxPrefConfig& operator=(const wxPrefConfig&);
ffecfa5a
JS
78
79 // current path (not '/' terminated)
80 wxString m_strPath;
23a59c2c
WS
81
82 // current path (group) content (cache for read/write)
83 wxString m_strGroup;
84
85 // current group modified ?
86 bool m_modGroup;
ffecfa5a
JS
87};
88
23a59c2c
WS
89#endif // _PREFCONF_H_
90