build: clFiles support cflags, reuse llvm.Env; cpp/inih: _wrap/reader.cpp

This commit is contained in:
xushiwei
2024-07-13 18:55:09 +08:00
parent af54a22d16
commit a3ea4798bc
4 changed files with 40 additions and 19 deletions

View File

@@ -6,7 +6,7 @@ import (
"github.com/goplus/llgo/cpp/std"
)
func main() {
func demoFromBuffer() {
buf := `[settings]
username=admin
timeout=100
@@ -19,8 +19,10 @@ timeout=100
name := std.Str("timeout")
value := reader.GetInteger(sec, name, 0)
println("value:", value)
}
reader = inih.NewReaderFile(std.Str("config.ini"))
func demoFromFile() {
reader := inih.NewReaderFile(std.Str("config.ini"))
defer reader.Dispose()
if ret := reader.ParseError(); ret != 0 {
@@ -33,3 +35,8 @@ timeout=100
println("s:", s.Str())
println("isDatabaseEnabled:", isDatabaseEnabled, "port:", port)
}
func main() {
demoFromBuffer()
demoFromFile()
}