mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-06 03:44:14 +00:00
Add a getter for all defined Sections in parsecfg (#15450)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user