本文整理汇总了C++中TCfg::getI方法的典型用法代码示例。如果您正苦于以下问题:C++ TCfg::getI方法的具体用法?C++ TCfg::getI怎么用?C++ TCfg::getI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCfg
的用法示例。
在下文中一共展示了TCfg::getI方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cfgChange
bool TMdContr::cfgChange( TCfg &icfg )
{
TController::cfgChange(icfg);
try
{
if(icfg.name() == "EndPoint" && enableStat())
{
tr.at().setAddr("TCP:"+epParse());
ResAlloc res(nodeRes(), false);
SecuritySetting ss("", -1);
if(epLst.find(icfg.getS()) != epLst.end()) ss = epLst[icfg.getS()];
res.release();
if(ss.policy.size() && mSecPol.fld().values().find(ss.policy) != string::npos)
{
setSecPolicy(ss.policy);
setSecMessMode(ss.messageMode);
}
XML_N req("opc.tcp");
//> Send FindServers request for EndPoints list provide
req.setAttr("id", "FindServers");
reqService(req);
res.request(true);
epLst.clear();
for(unsigned i_s = 0; i_s < req.childSize(); i_s++)
for(unsigned i_d = 0; i_d < req.childGet(i_s)->childSize(); i_d++)
epLst[req.childGet(i_s)->childGet(i_d)->text()] = SecuritySetting();
res.release();
//> Send GetEndpoints request for EndPoints list provide
req.clear()->setAttr("id", "GetEndpoints");
reqService(req);
res.request(true);
for(unsigned i_ch = 0; i_ch < req.childSize(); i_ch++)
{
XML_N *xep = req.childGet(i_ch);
string ep = xep->attr("endpointUrl");
if(epLst.find(ep) != epLst.end()) ep += "/"+TSYS::strParse(xep->attr("securityPolicyUri"),1,"#")+"/"+xep->attr("securityMode");
epLst[ep] = SecuritySetting(TSYS::strParse(xep->attr("securityPolicyUri"),1,"#"), atoi(xep->attr("securityMode").c_str()));
}
}
else if(icfg.name() == "SecPolicy")
{
if(icfg.getS() == "None" && secMessMode() != MS_None) setSecMessMode(MS_None);
if(icfg.getS() != "None" && secMessMode() == MS_None) setSecMessMode(MS_Sign);
}
else if(icfg.name() == "SecMessMode" &&
((icfg.getI() != MS_None && secPolicy() == "None") || (icfg.getI() == MS_None && secPolicy() != "None")))
return false;
} catch(...) { }
return true;
}
示例2: getVal
string MTable::getVal( TCfg &cfg )
{
switch( cfg.fld().type() )
{
case TFld::String: return cfg.getS();
case TFld::Integer: return SYS->int2str(cfg.getI());
case TFld::Real: return SYS->real2str(cfg.getR());
case TFld::Boolean: return SYS->int2str(cfg.getB());
default: break;
}
return "";
}
示例3:
bool TCfg::operator==( TCfg &cfg )
{
if(fld().type() == cfg.fld().type())
switch(fld().type()) {
case TFld::String: return (getS() == cfg.getS());
case TFld::Integer: return (getI() == cfg.getI());
case TFld::Real: return (getR() == cfg.getR());
case TFld::Boolean: return (getB() == cfg.getB());
default: break;
}
return false;
}
示例4: getVal
string MTable::getVal( TCfg &cfg, db_str_rec *fld_rec )
{
string rez;
switch(cfg.fld().type()) {
case TFld::Boolean: rez = cfg.getB() ? "T" : "F"; break;
case TFld::Integer: rez = i2s(cfg.getI()); break;
case TFld::Real: {
if(!fld_rec) { rez = r2s(cfg.getR()); break; }
char str[200];
snprintf(str, sizeof(str), "%*.*f", fld_rec->len_fild, fld_rec->dec_field, cfg.getR());
rez = str;
break;
}
default: rez = Mess->codeConvOut(codepage, cfg.getS()); break;
}
return rez;
}