llcppsymg:language config

This commit is contained in:
luoliwoshang
2024-09-05 10:48:45 +08:00
parent 7a068450b3
commit caa707325a

View File

@@ -26,6 +26,7 @@ func GetConf(data []byte) (Conf, error) {
Libs: GetStringItem(parsedConf, "libs", ""),
Include: GetStringArrayItem(parsedConf, "include"),
TrimPrefixes: GetStringArrayItem(parsedConf, "trimPrefixes"),
Cplusplus: GetBoolItem(parsedConf, "cplusplus"),
}
return Conf{
@@ -58,3 +59,14 @@ func GetStringArrayItem(obj *cjson.JSON, key string) (value []string) {
}
return
}
func GetBoolItem(obj *cjson.JSON, key string) bool {
item := obj.GetObjectItemCaseSensitive(c.AllocaCStr(key))
if item == nil {
return false
}
if item.IsBool() != 0 {
return item.IsTrue() != 0
}
return false
}