KvConfigContains
KvConfigContains
Description
Check whether a key exists in config.
Parameters
| Name | Direction | Description |
|---|---|---|
cfg |
in,out | Parsed config. |
key |
in | Zero-terminated key string. |
Success
true if key exists.
Failure
false
Usage example (Cross-references)
Usage examples (Cross-references)
- In
KvConfig.c:433:
}
bool KvConfigContains(KvConfig *cfg, const char *key) {
return KvConfigGetPtr(cfg, key) != NULL;
}- In
Parse.c:22:
result = result && (si.pos == si.length);
result = result && (KvConfigLen(&cfg) == 3);
result = result && KvConfigContains(&cfg, "host");
result = result && host && StrCmpZstr(host, "localhost") == 0;
result = result && KvConfigGetI64(&cfg, "port", &port) && (port == 8080);- In
Parse.c:139:
result = result && (si.pos == 0);
result = result && KvConfigGetBool(&cfg, "valid", &enabled) && enabled;
result = result && !KvConfigContains(&cfg, "later");
StrDeinit(&src);
Last updated on