diff --git a/comp/src/gb.settings/.component b/comp/src/gb.settings/.component index 5da61c896..6167ea23a 100644 --- a/comp/src/gb.settings/.component +++ b/comp/src/gb.settings/.component @@ -1,4 +1,4 @@ [Component] Key=gb.settings -Version=3.15.90 +Version=3.16.0 Authors=Benoît Minisini diff --git a/comp/src/gb.settings/.project b/comp/src/gb.settings/.project index b3dff63e8..befee5a59 100644 --- a/comp/src/gb.settings/.project +++ b/comp/src/gb.settings/.project @@ -1,7 +1,7 @@ # Gambas Project File 3.0 Title=Gambas settings management Startup=Main -Version=3.15.90 +Version=3.16.0 VersionFile=1 Authors="Benoît Minisini" TabSize=2 diff --git a/comp/src/gb.settings/.src/Settings.class b/comp/src/gb.settings/.src/Settings.class index bc47e6e53..a8e1a9b81 100644 --- a/comp/src/gb.settings/.src/Settings.class +++ b/comp/src/gb.settings/.src/Settings.class @@ -15,6 +15,8 @@ Static Private $iPos As Integer Property Read Keys As _Settings_Keys Property Read Path As String + +'' Return the number of entries in the settings file Property Read Count As Integer Private $sPath As String @@ -232,6 +234,8 @@ Public Function _get(Key As String, Optional {Default} As Variant) As Variant End +'' Return if the specified settings key has a value + Public Sub Exist(Key As String) As Boolean Dim hSlot As Collection @@ -612,6 +616,8 @@ Static Private Sub WriteValue(vVal As Variant) End +'' Convert a value into its settings internal string representation + Static Public Sub ToString(Value As Variant) As String $sStr = "" @@ -848,6 +854,7 @@ Static Private Sub ReadValue(Optional bNotStrict As Boolean) As Variant End +'' Return a value from its settings internal string representation Static Public Sub FromString(Value As String) As Variant diff --git a/comp/src/gb.settings/.src/_Settings_Keys.class b/comp/src/gb.settings/.src/_Settings_Keys.class index 96f1b197f..29b58a1f3 100644 --- a/comp/src/gb.settings/.src/_Settings_Keys.class +++ b/comp/src/gb.settings/.src/_Settings_Keys.class @@ -1,9 +1,14 @@ ' Gambas class file +''' This virtual class allows to enumerate all top-level keys of a settings file, or all keys under a specific slot. + Export Create Static +'' Return the number of keys of the current parent slot, or the number of top-level slots. Property Read Count As Integer + +'' Return all keys of the current parent slot, or all top-level keys, as a string array. Property Read All As String[] Public _Slot As Collection @@ -11,6 +16,8 @@ Public _Parent As String Private $aKeys As String[] +'' Return a virtual object used for enumerating all keys under the given ~Parent~ key of the setting file. + Public Sub _get(Parent As String) As _Settings_Keys Dim hKeys As _Settings_Keys @@ -45,6 +52,8 @@ Private Sub GetKeys() As Boolean End +'' Enumerate the keys of the current parent slot, or the settings files top-level slots. + Public Sub _next() As String Dim sKey As String @@ -67,6 +76,8 @@ Public Sub _next() As String End +'' Return if the current parent slot has the specific key, or if there is a top-level slot with that key. + Public Sub Exist(Key As String) As Boolean If Not $aKeys Then GetKeys()