Skip to content
KvConfigContains

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)
    }
    
    bool KvConfigContains(KvConfig *cfg, const char *key) {
        return KvConfigGetPtr(cfg, key) != NULL;
    }
        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);
        result = result && (si.pos == 0);
        result = result && KvConfigGetBool(&cfg, "valid", &enabled) && enabled;
        result = result && !KvConfigContains(&cfg, "later");
    
        StrDeinit(&src);
Last updated on