Add documentation.

[GB.SETTINGS]
* NEW: Add documentation.
This commit is contained in:
gambas 2021-04-13 17:20:32 +02:00
parent 275a42323f
commit f2bb2b41cf
4 changed files with 20 additions and 2 deletions

View file

@ -1,4 +1,4 @@
[Component]
Key=gb.settings
Version=3.15.90
Version=3.16.0
Authors=Benoît Minisini

View file

@ -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

View file

@ -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

View file

@ -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()