version 0.8.8

This commit is contained in:
Andreas Rumpf
2010-03-14 01:25:25 +01:00
parent 3dafd6856b
commit 7bf98411b6
52 changed files with 15732 additions and 6193 deletions

25
examples/parsecfgex.nim Executable file
View File

@@ -0,0 +1,25 @@
import
os, parsecfg, strutils, streams
var f = newFileStream(paramStr(1), fmRead)
if f != nil:
var p: TCfgParser
open(p, f, paramStr(1))
while true:
var e = next(p)
case e.kind
of cfgEof:
echo("EOF!")
break
of cfgSectionStart: ## a ``[section]`` has been parsed
echo("new section: " & e.section)
of cfgKeyValuePair:
echo("key-value-pair: " & e.key & ": " & e.value)
of cfgOption:
echo("command: " & e.key & ": " & e.value)
of cfgError:
echo(e.msg)
close(p)
else:
echo("cannot open: " & paramStr(1))