本文整理汇总了C++中Params::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Params::begin方法的具体用法?C++ Params::begin怎么用?C++ Params::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Params
的用法示例。
在下文中一共展示了Params::begin方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildAuthHeader
std::string OAuthPrivate::buildAuthHeader(const std::string & method, const std::string & url, Params data, const std::string & verifier){
Params params;
params.insert(std::pair<std::string, std::string>("oauth_consumer_key", consumerKey));
params.insert(std::pair<std::string, std::string>("oauth_nonce", Helper::identifier(42)));
//params.insert(std::pair<std::string, std::string>("oauth_nonce", "Qr2DJzLO3iZCRnqN7hRvJCX5VZFk62fh2Qrbx3Snzl"));
params.insert(std::pair<std::string, std::string>("oauth_signature_method", "HMAC-SHA1"));
params.insert(std::pair<std::string, std::string>("oauth_timestamp", NumberFormatter::format(Helper::timestamp())));
//params.insert(std::pair<std::string, std::string>("oauth_timestamp", "1363740223"));
params.insert(std::pair<std::string, std::string>("oauth_version", "1.0"));
if(!verifier.empty())
params.insert(std::pair<std::string, std::string>("oauth_verifier", verifier));
if(!oauthToken.empty())
params.insert(std::pair<std::string, std::string>("oauth_token", oauthToken));
params.insert(data.begin(), data.end());
params.insert(std::pair<std::string, std::string>("oauth_signature", signature(signingKey(consumerSecret, oauthTokenSecret), baseString(method, url, paramsString(params)))));
std::string authStr;
ParamsIterator it;
for(it = params.begin(); it != params.end(); it++){
std::string key = (*it).first;
std::string val = (*it).second;
authStr += URI(key).toString() + "=\"" + Helper::urlencode(val) + "\", ";
}
return authStr.substr(0, authStr.length() - 2);
}
示例2:
template <typename T> void
GenericFactor<T>::cartesianProduct (
Params::const_iterator first2,
Params::const_iterator last2)
{
Params backup = params_;
params_.clear();
params_.reserve (params_.size() * (last2 - first2));
Params::const_iterator first1 = backup.begin();
Params::const_iterator last1 = backup.end();
Params::const_iterator tmp;
if (Globals::logDomain) {
for (; first1 != last1; ++first1) {
for (tmp = first2; tmp != last2; ++tmp) {
params_.push_back ((*first1) + (*tmp));
}
}
} else {
for (; first1 != last1; ++first1) {
for (tmp = first2; tmp != last2; ++tmp) {
params_.push_back ((*first1) * (*tmp));
}
}
}
}
示例3: paramsString
std::string OAuthPrivate::paramsString(Params params){
std::string paramStr;
ParamsIterator it;
for(it = params.begin(); it != params.end(); it++){
std::string key = (*it).first;
std::string val = (*it).second;
paramStr += URI(key).toString() + "=" + Helper::urlencode(val) + "&";
}
return paramStr.substr(0, paramStr.length() - 1);
}
示例4: MURegister
Params CB_MessageDeal::MURegister(Params in_params)
{
std::cout<<"This is MURegister callbakc"<<std::endl;
Params inp = in_params;
Params::iterator iter;
for(iter=inp.begin(); iter != inp.end(); iter++) {
std::cout<<(*iter).first<<" : "<<(*iter).second<<std::endl;
}
Params outp;
outp["code"] = "0";
outp["result"] = "success";
outp["muKeepAlivePeriod"] = "100s";
return outp;
}
示例5: do_spliced_alignment
void GSQAligner::do_spliced_alignment(const string& genomic_file, const string& type, const string& query_file, const string& species, const Params& params, const string& output_file, const string& hit_contig_file){
string param_list = "";
for ( Params::const_iterator it = params.begin(); it != params.end(); ++it ){
param_list += " -" + it->first + " " + it->second;
}
string type_str = "E";
string species_str = species_names[species];
if (species_str == "")
species_str = "generic";
if (type == "protein")
type_str = "Q";
string cmd = "GeneSeqer -L " + genomic_file + " -" + type_str + " " + query_file + " -species " + species_str + " " + param_list + " -o " + output_file + " >> " + logger->get_log_file() + " 2>&1";
logger->debug(cmd);
run_shell_command(cmd);
//get_aligned_contigs(genomic_file, hit_contig_file, output_file);
}
示例6: HandleLocal
CmdResult HandleLocal(LocalUser* user, const Params& parameters) override
{
if (parameters.empty())
{
HandleList(user, false);
return CMD_SUCCESS;
}
bool watch_l_done = false;
bool watch_s_done = false;
for (std::vector<std::string>::const_iterator i = parameters.begin(); i != parameters.end(); ++i)
{
const std::string& token = *i;
char subcmd = toupper(token[0]);
if (subcmd == '+')
{
HandlePlus(user, token.substr(1));
}
else if (subcmd == '-')
{
HandleMinus(user, token.substr(1));
}
else if (subcmd == 'C')
{
manager.UnwatchAll(user);
}
else if ((subcmd == 'L') && (!watch_l_done))
{
watch_l_done = true;
// WATCH L requests a full list with online and offline nicks
// WATCH l requests a list with only online nicks
HandleList(user, (token[0] == 'L'));
}
else if ((subcmd == 'S') && (!watch_s_done))
{
watch_s_done = true;
HandleStats(user);
}
}
return CMD_SUCCESS;
}
示例7: parse
void parse(const Params& params)
{
for ( Params::const_iterator it = params.begin(), itEnd = params.end();
it != itEnd; ++it )
{
if ( it->first == "quality" ) {
quality_ = it->second.as<size_t>(quality_);
continue;
}
if ( it->first == "min_luminance" ) {
minLuminance_ = it->second.as<float>(minLuminance_);
continue;
}
if ( it->first == "max_luminance" ) {
maxLuminance_ = it->second.as<float>(maxLuminance_);
continue;
}
if ( it->first == "mapping_method" ) {
luminanceMapping_ = it->second.as<RGBMappingType>(luminanceMapping_);
continue;
}
}
}