本文整理汇总了C++中variables_map::at方法的典型用法代码示例。如果您正苦于以下问题:C++ variables_map::at方法的具体用法?C++ variables_map::at怎么用?C++ variables_map::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类variables_map
的用法示例。
在下文中一共展示了variables_map::at方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plugin_initialize
void http_client_plugin::plugin_initialize(const variables_map& options) {
if ( options.count("https-client-root-cert") ) {
const std::vector<std::string> root_pems = options["https-client-root-cert"].as<std::vector<std::string>>();
for (const auto& root_pem : root_pems) {
std::string pem_str = root_pem;
if (!boost::algorithm::starts_with(pem_str, "-----BEGIN CERTIFICATE-----\n")) {
try {
auto infile = std::ifstream(pem_str);
std::stringstream sstr;
sstr << infile.rdbuf();
pem_str = sstr.str();
FC_ASSERT(boost::algorithm::starts_with(pem_str, "-----BEGIN CERTIFICATE-----\n"), "File does not appear to be a PEM encoded certificate");
} catch (const fc::exception& e) {
elog("Failed to read PEM ${f} : ${e}", ("f", root_pem)("e",e.to_detail_string()));
}
}
try {
my->add_cert(pem_str);
} catch (const fc::exception& e) {
elog("Failed to read PEM : ${e} \n${pem}\n", ("pem", pem_str)("e",e.to_detail_string()));
}
}
}
my->set_verify_peers(options.at("https-client-validate-peers").as<bool>());
}
示例2: plugin_initialize
void wallet_api_plugin::plugin_initialize(const variables_map& options) {
if (options.count("http-server-address")) {
const auto& lipstr = options.at("http-server-address").as<string>();
const auto& host = lipstr.substr(0, lipstr.find(':'));
if (host != "localhost" && host != "127.0.0.1") {
wlog("\n"
"*************************************\n"
"* *\n"
"* -- Wallet NOT on localhost -- *\n"
"* - Password and/or Private Keys - *\n"
"* - are transferred unencrypted. - *\n"
"* *\n"
"*************************************\n");
}
}
}
示例3: plugin_initialize
void history_plugin::plugin_initialize(const variables_map& options) {
if(options.count("filter_on_accounts"))
{
auto foa = options.at("filter_on_accounts").as<vector<string>>();
for(auto filter_account : foa)
my->filter_on.emplace(filter_account);
}
my->chain_plug = app().find_plugin<chain_plugin>();
auto& chain = my->chain_plug->chain();
chain.db().add_index<account_history_index>();
chain.db().add_index<action_history_index>();
chain.applied_transaction.connect( [&]( const transaction_trace_ptr& p ){
my->on_applied_transaction(p);
});
}
示例4: plugin_initialize
void txn_test_gen_plugin::plugin_initialize(const variables_map& options) {
try {
my.reset( new txn_test_gen_plugin_impl );
my->txn_reference_block_lag = options.at( "txn-reference-block-lag" ).as<int32_t>();
} FC_LOG_AND_RETHROW()
}