当前位置: 首页>>代码示例>>C++>>正文


C++ variables_map::at方法代码示例

本文整理汇总了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>());
}
开发者ID:108518,项目名称:eos,代码行数:27,代码来源:http_client_plugin.cpp

示例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");
      }
   }
}
开发者ID:sgerov,项目名称:eos,代码行数:16,代码来源:wallet_api_plugin.cpp

示例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);
      });

   }
开发者ID:wood19910377,项目名称:eos,代码行数:19,代码来源:history_plugin.cpp

示例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()
}
开发者ID:milk57618,项目名称:eos,代码行数:6,代码来源:txn_test_gen_plugin.cpp


注:本文中的variables_map::at方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。