X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..7d4911333fc8fedcb8d02974394f30e4286b5a56:/interface/wx/config.h diff --git a/interface/wx/config.h b/interface/wx/config.h index 1f7db64161..258938bf09 100644 --- a/interface/wx/config.h +++ b/interface/wx/config.h @@ -8,7 +8,6 @@ /** @class wxConfigBase - @wxheader{config.h} wxConfigBase defines the basic interface of all config classes. It can not be used by itself (it is an abstract base class) and you will always use @@ -256,7 +255,7 @@ @library{wxbase} - @category{misc} + @category{cfg} */ class wxConfigBase : public wxObject { @@ -336,7 +335,7 @@ public: /** Empty but ensures that dtor of all derived classes is virtual. */ - ~wxConfigBase(); + virtual ~wxConfigBase(); /** @@ -349,14 +348,14 @@ public: /** Retrieve the current path (always as absolute path). */ - const wxString GetPath() const; + virtual const wxString& GetPath() const = 0; /** Set current path: if the first character is '/', it is the absolute path, otherwise it is a relative path. '..' is supported. If @a strPath doesn't exist it is created. */ - void SetPath(const wxString& strPath); + virtual void SetPath(const wxString& strPath) = 0; //@} @@ -375,8 +374,13 @@ public: The wxPython version of this method returns a 3-tuple consisting of the continue flag, the value string, and the index for the next call. @endWxPythonOnly + + @beginWxPerlOnly + In wxPerl this method takes no parameters and returns a 3-element + list (continue_flag, string, index_for_getnextentry). + @endWxPerlOnly */ - bool GetFirstEntry(wxString& str, long& index) const; + virtual bool GetFirstEntry(wxString& str, long& index) const = 0; /** Gets the first group. @@ -385,8 +389,13 @@ public: The wxPython version of this method returns a 3-tuple consisting of the continue flag, the value string, and the index for the next call. @endWxPythonOnly + + @beginWxPerlOnly + In wxPerl this method takes no parameters and returns a 3-element + list (continue_flag, string, index_for_getnextentry). + @endWxPerlOnly */ - bool GetFirstGroup(wxString& str, long& index) const; + virtual bool GetFirstGroup(wxString& str, long& index) const = 0; /** Gets the next entry. @@ -395,8 +404,14 @@ public: The wxPython version of this method returns a 3-tuple consisting of the continue flag, the value string, and the index for the next call. @endWxPythonOnly + + @beginWxPerlOnly + In wxPerl this method only takes the @a index parameter and + returns a 3-element list (continue_flag, string, + index_for_getnextentry). + @endWxPerlOnly */ - bool GetNextEntry(wxString& str, long& index) const; + virtual bool GetNextEntry(wxString& str, long& index) const = 0; /** Gets the next group. @@ -405,19 +420,25 @@ public: The wxPython version of this method returns a 3-tuple consisting of the continue flag, the value string, and the index for the next call. @endWxPythonOnly + + @beginWxPerlOnly + In wxPerl this method only takes the @a index parameter and + returns a 3-element list (continue_flag, string, + index_for_getnextentry). + @endWxPerlOnly */ - bool GetNextGroup(wxString& str, long& index) const; + virtual bool GetNextGroup(wxString& str, long& index) const = 0; /** Get number of entries in the current group. */ - uint GetNumberOfEntries(bool bRecursive = false) const; + virtual size_t GetNumberOfEntries(bool bRecursive = false) const = 0; /** Get number of entries/subgroups in the current group, with or without its subgroups. */ - uint GetNumberOfGroups(bool bRecursive = false) const; + virtual size_t GetNumberOfGroups(bool bRecursive = false) const = 0; //@} @@ -439,7 +460,7 @@ public: /** @return @true if either a group or an entry with a given name exists. */ - bool Exists(wxString& strName) const; + bool Exists(const wxString& strName) const; /** Returns the type of the given entry or @e Unknown if the entry doesn't @@ -448,17 +469,17 @@ public: about type mismatch otherwise: e.g., an attempt to read a string value from an integer key with wxRegConfig will fail. */ - wxConfigBase::EntryType GetEntryType(const wxString& name) const; + virtual wxConfigBase::EntryType GetEntryType(const wxString& name) const; /** @return @true if the entry by this name exists. */ - bool HasEntry(wxString& strName) const; + virtual bool HasEntry(const wxString& strName) const = 0; /** @return @true if the group by this name exists. */ - bool HasGroup(const wxString& strName) const; + virtual bool HasGroup(const wxString& strName) const = 0; //@} @@ -492,11 +513,15 @@ public: Permanently writes all changes (otherwise, they're only written from object's destructor). */ - bool Flush(bool bCurrentOnly = false); + virtual bool Flush(bool bCurrentOnly = false) = 0; /** Read a string from the key, returning @true if the value was read. If the key was not found, @a str is not changed. + + @beginWxPerlOnly + Not supported by wxPerl. + @endWxPerlOnly */ bool Read(const wxString& key, wxString* str) const; /** @@ -504,77 +529,117 @@ public: was not found. @return @true if value was really read, @false if the default was used. + + @beginWxPerlOnly + Not supported by wxPerl. + @endWxPerlOnly */ - const bool Read(const wxString& key, wxString* str, - const wxString& defaultVal) const; + bool Read(const wxString& key, wxString* str, + const wxString& defaultVal) const; /** Another version of Read(), returning the string value directly. + + @beginWxPerlOnly + In wxPerl, this can be called as: + - Read(key): returns the empty string if no key is found + - Read(key, default): returns the default value if no key is found + @endWxPerlOnly */ const wxString Read(const wxString& key, - const wxString& defaultVal) const; + const wxString& defaultVal) const; /** Reads a long value, returning @true if the value was found. If the value was not found, @a l is not changed. + + @beginWxPerlOnly + Not supported by wxPerl. + @endWxPerlOnly */ - const bool Read(const wxString& key, long* l) const; + bool Read(const wxString& key, long* l) const; /** Reads a long value, returning @true if the value was found. If the value was not found, @a defaultVal is used instead. + + @beginWxPerlOnly + In wxPerl, this can be called as: + - ReadInt(key): returns the 0 if no key is found + - ReadInt(key, default): returns the default value if no key is found + @endWxPerlOnly */ - const bool Read(const wxString& key, long* l, - long defaultVal) const; + bool Read(const wxString& key, long* l, + long defaultVal) const; /** Reads a double value, returning @true if the value was found. If the value was not found, @a d is not changed. + + @beginWxPerlOnly + Not supported by wxPerl. + @endWxPerlOnly */ - const bool Read(const wxString& key, double* d) const; + bool Read(const wxString& key, double* d) const; /** Reads a double value, returning @true if the value was found. If the value was not found, @a defaultVal is used instead. + + @beginWxPerlOnly + In wxPerl, this can be called as: + - ReadFloat(key): returns the 0.0 if no key is found + - ReadFloat(key, default): returns the default value if no key is found + @endWxPerlOnly */ - const bool Read(const wxString& key, double* d, + bool Read(const wxString& key, double* d, double defaultVal) const; /** Reads a bool value, returning @true if the value was found. If the value was not found, @a b is not changed. + + @beginWxPerlOnly + Not supported by wxPerl. + @endWxPerlOnly */ - const bool Read(const wxString& key, bool* b) const; + bool Read(const wxString& key, bool* b) const; /** Reads a bool value, returning @true if the value was found. If the value was not found, @a defaultVal is used instead. + + @beginWxPerlOnly + In wxPerl, this can be called as: + - ReadBool(key): returns false if no key is found + - ReadBool(key, default): returns the default value if no key is found + @endWxPerlOnly */ - const bool Read(const wxString& key, bool* d, - bool defaultVal) const; + bool Read(const wxString& key, bool* d, + bool defaultVal) const; /** Reads a binary block, returning @true if the value was found. If the value was not found, @a buf is not changed. */ - const bool Read(const wxString& key, wxMemoryBuffer* buf) const; + bool Read(const wxString& key, wxMemoryBuffer* buf) const; /** Reads a value of type T, for which function wxFromString() is defined, returning @true if the value was found. If the value was not found, @a value is not changed. */ - const bool Read(const wxString& key, T* value) const; + bool Read(const wxString& key, T* value) const; /** Reads a value of type T, for which function wxFromString() is defined, returning @true if the value was found. If the value was not found, @a defaultVal is used instead. */ - const bool Read(const wxString& key, T* value, - const T& defaultVal) const; + bool Read(const wxString& key, T* value, + const T& defaultVal) const; /** Reads a bool value from the key and returns it. @a defaultVal is returned if the key is not found. */ - long ReadBool(const wxString& key, bool defaultVal) const; + bool ReadBool(const wxString& key, bool defaultVal) const; /** Reads a double value from the key and returns it. @a defaultVal is returned if the key is not found. */ - long ReadDouble(const wxString& key, double defaultVal) const; + double ReadDouble(const wxString& key, double defaultVal) const; /** Reads a long value from the key and returns it. @a defaultVal is @@ -640,7 +705,8 @@ public: @return @false if @a oldName doesn't exist or if @a newName already exists. */ - bool RenameEntry(const wxString& oldName, const wxString& newName); + virtual bool RenameEntry(const wxString& oldName, + const wxString& newName) = 0; /** Renames a subgroup of the current group. The subgroup names (both the @@ -650,7 +716,8 @@ public: @return @false if @a oldName doesn't exist or if @a newName already exists. */ - bool RenameGroup(const wxString& oldName, const wxString& newName); + virtual bool RenameGroup(const wxString& oldName, + const wxString& newName) = 0; //@} @@ -668,14 +735,14 @@ public: Delete the whole underlying object (disk file, registry key, ...). Primarly for use by uninstallation routine. */ - bool DeleteAll(); + virtual bool DeleteAll() = 0; /** Deletes the specified entry and the group it belongs to if it was the last key in it and the second parameter is @true. */ - bool DeleteEntry(const wxString& key, - bool bDeleteGroupIfEmpty = true); + virtual bool DeleteEntry(const wxString& key, + bool bDeleteGroupIfEmpty = true) = 0; /** Delete the group (with all subgroups). If the current path is under the @@ -683,7 +750,7 @@ public: component. E.g. if the current path is @c "/A/B/C/D" and the group @c C is deleted, the path becomes @c "/A/B". */ - bool DeleteGroup(const wxString& key); + virtual bool DeleteGroup(const wxString& key) = 0; //@}