提交 850d92ba 编写于 作者: P Palana

libobs: Add config_has_(user|default)_value functions

Similar to obs_data_has_(user_value|default|autoselect), these allow
library users to distinguish between user config values and default
values
上级 10a6ffdb
......@@ -598,3 +598,16 @@ double config_get_default_double(config_t config, const char *section,
return 0.0;
}
bool config_has_user_value(config_t config, const char *section,
const char *name)
{
return config_find_item(&config->sections, section, name) != NULL;
}
bool config_has_default_value(config_t config, const char *section,
const char *name)
{
return config_find_item(&config->defaults, section, name) != NULL;
}
......@@ -112,6 +112,11 @@ EXPORT bool config_get_default_bool(config_t config, const char *section,
EXPORT double config_get_default_double(config_t config, const char *section,
const char *name);
EXPORT bool config_has_user_value(config_t config, const char *section,
const char *name);
EXPORT bool config_has_default_value(config_t config, const char *section,
const char *name);
#ifdef __cplusplus
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册