本文整理汇总了C++中Hdf::configGet方法的典型用法代码示例。如果您正苦于以下问题:C++ Hdf::configGet方法的具体用法?C++ Hdf::configGet怎么用?C++ Hdf::configGet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hdf
的用法示例。
在下文中一共展示了Hdf::configGet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Get
const char* Config::Get(const IniSetting::Map &ini, const Hdf& config,
const std::string& name /* = "" */,
const char *defValue /* = nullptr */,
const bool prepend_hhvm /* = true */) {
auto ini_name = IniName(name, prepend_hhvm);
Hdf hdf = name != "" ? config[name] : config;
auto* value = ini_iterate(ini, ini_name);
if (value && value->isString()) {
// See generic Get##METHOD below for why we are doing this
const char* ini_ret = value->data();
const char* hdf_ret = hdf.configGet(value->data());
if (hdf_ret != ini_ret) {
ini_ret = hdf_ret;
IniSetting::Set(ini_name, ini_ret);
}
return ini_ret;
}
return hdf.configGet(defValue);
}
示例2: Get
// This method must return a char* which is owned by the IniSettingMap
// to avoid issues with the lifetime of the char*
const char* Config::Get(const IniSettingMap &ini, const Hdf& config,
const std::string& name /* = "" */,
const char *defValue /* = nullptr */,
const bool prepend_hhvm /* = true */) {
auto ini_name = IniName(name, prepend_hhvm);
Hdf hdf = name != "" ? config[name] : config;
auto value = ini_iterate(ini, ini_name);
if (value.isString()) {
// See generic Get##METHOD below for why we are doing this
// Note that value is a string, so value.toString() is not
// a temporary.
const char* ini_ret = value.toString().data();
const char* hdf_ret = hdf.configGet(ini_ret);
if (hdf_ret != ini_ret) {
ini_ret = hdf_ret;
IniSetting::SetSystem(ini_name, ini_ret);
}
return ini_ret;
}
return hdf.configGet(defValue);
}
示例3: Bind
void Config::Bind(std::vector<std::string>& loc, const IniSettingMap& ini,
const Hdf& config) {
std::vector<std::string> ret;
auto ini_name = IniName(config);
auto* value = ini.get_ptr(ini_name);
if (value && value->isObject()) {
ini_on_update(*value, ret);
loc = ret;
}
// If there is an HDF setting for the config, then it still wins for
// the RuntimeOption value until we obliterate HDFs
ret.clear();
config.configGet(ret);
if (ret.size() > 0) {
loc = ret;
}
IniSetting::Bind(IniSetting::CORE, IniSetting::PHP_INI_SYSTEM, ini_name,
&loc);
}