-
- // key access
- // read a string or long value from the key. If the key is not
- // found the default value is returned.
- virtual const char *Read(const char *szKey,
- const char *szDefault = NULL) const = 0;
- virtual long Read(const char *szKey, long lDefault) const = 0;
+ // get number of entries/subgroups in the current group, with or without
+ // it's subgroups
+ virtual uint GetNumberOfEntries(bool bRecursive = FALSE) const = 0;
+ virtual uint GetNumberOfGroups(bool bRecursive = FALSE) const = 0;
+
+ // tests of existence
+ // returns TRUE if the group by this name exists
+ virtual bool HasGroup(const wxString& strName) const = 0;
+ // same as above, but for an entry
+ virtual bool HasEntry(const wxString& strName) const = 0;
+ // returns TRUE if either a group or an entry with a given name exist
+ bool Exists(const wxString& strName) const
+ { return HasGroup(strName) || HasEntry(strName); }
+
+ // key access: returns TRUE if value was really read, FALSE if default used
+ // (and if the key is not found the default value is returned.)
+ // read a string from the key
+ virtual bool Read(wxString *pStr, const char *szKey,
+ const char *szDefault = NULL) const = 0;
+ // another version using statis buffer - it means it will be overwritten
+ // after each call to this function!
+ virtual const char *Read(const char *szKey,
+ const char *szDefault = NULL) const;
+ // the same for longs
+ virtual long Read(const char *szKey, long lDefault) const
+ { long l; Read(&l, szKey, lDefault); return l; }
+ // and another version: returns true if default value is returned
+ virtual bool Read(long *pl, const char *szKey, long lDefault = 0) const = 0;