Add a getter for all defined Sections in parsecfg (#15450)
This commit is contained in:
parent
eb3ed44009
commit
207bcabdf2
3 changed files with 17 additions and 14 deletions
|
|
@ -174,6 +174,7 @@ runnableExamples:
|
|||
|
||||
import strutils, lexbase, streams, tables
|
||||
import std/private/decode_helpers
|
||||
import std/private/since
|
||||
|
||||
include "system/inclrtl"
|
||||
|
||||
|
|
@ -649,3 +650,8 @@ proc delSectionKey*(dict: var Config, section, key: string) =
|
|||
dict.del(section)
|
||||
else:
|
||||
dict[section].del(key)
|
||||
|
||||
iterator sections*(dict: Config): lent string {.since: (1, 5).} =
|
||||
## Iterates through the sections in the `dict`.
|
||||
for section in dict.keys:
|
||||
yield section
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue