KvConfigContains
Description
Check whether a key exists in config.
Parameters
| Name | Direction | Description |
|---|---|---|
cfg |
in,out | Parsed config. |
key |
in | Lookup key. Prefer Str *; Zstr accepted. |
Success
true if key exists.
Failure
false
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Parse.c:231:
// key is not stored.
result = result && (StrIterIndex(&si) == 0);
result = result && !KvConfigContains(&cfg, "k");
StrDeinit(&src);- In
Parse.c:301:
result = result && (StrIterIndex(&si) == StrIterLength(&si));
result = result && (MapPairCount(&cfg) == 1);
result = result && KvConfigContains(&cfg, "k");
StrDeinit(&src);- In
Parse.c:327:
result = result && (StrIterIndex(&si) == StrIterLength(&si));
result = result && (MapPairCount(&cfg) == 3);
result = result && KvConfigContains(&cfg, "host");
result = result && host && StrCmp(host, "localhost") == 0;
result = result && KvConfigGetI64(&cfg, "port", &port) && (port == 8080);- In
Parse.c:455:
result = result && (StrIterIndex(&si) == 0);
result = result && KvConfigGetBool(&cfg, "valid", &enabled) && enabled;
result = result && !KvConfigContains(&cfg, "later");
StrDeinit(&src);- In
Parse.c:531:
// contains via Str*
result = result && KvConfigContains(&cfg, &k_name);
result = result && !KvConfigContains(&cfg, &k_missing);- In
Parse.c:532:
// contains via Str*
result = result && KvConfigContains(&cfg, &k_name);
result = result && !KvConfigContains(&cfg, &k_missing);
// get copy via Str*
Last updated on