本文整理汇总了C++中TextParser::chkNode方法的典型用法代码示例。如果您正苦于以下问题:C++ TextParser::chkNode方法的具体用法?C++ TextParser::chkNode怎么用?C++ TextParser::chkNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextParser
的用法示例。
在下文中一共展示了TextParser::chkNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadDfiFile
//.........这里部分代码省略.........
}
else {
P0 = ct2;
}
//DiffPrs
label = "/Unit/DiffPrs";
if ( !(tpCntl.getInspectedValue(label, ct2 )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
else {
DiffPrs = ct2;
}
//FilePath
label = "/FilePath/Process";
if ( !(tpCntl.getInspectedValue(label, str )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
dfi_proc=str;
//read process
ReadDfiProc(dfi_proc);
//TimeSlice
nnode=0;
label_base = "/TimeSlice/Slice";
if ( tpCntl.chkNode(label_base) ) //nodeがあれば
{
nnode = tpCntl.countLabels(label_base);
}
label_base = "/TimeSlice";
for (int i=0; i<nnode; i++)
{
if ( !(tpCntl.getNodeStr(label_base, i+1, str)) )
{
printf("\tParsing error : No Elem name\n");
Exit(0);
}
if( strcasecmp(str.substr(0,5).c_str(), "Slice") ) continue;
//step
label=label_base+"/"+str+"/Step";
if ( !(tpCntl.getInspectedValue(label, ct )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
//time
label=label_base+"/"+str+"/Time";
if ( !(tpCntl.getInspectedValue(label, ct2 )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
SetSlice(ct,ct2);
示例2: ReadDfiProc
//.........这里部分代码省略.........
Exit(0);
}
else {
NumberOfGroup = ct;
}
////RankID_in_MPIworld
//label = "/DistributedFileInfo/RankIDinMPIworld";
//if ( !(tpCntl.getInspectedValue(label, &ct )) ) {
// Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
// Exit(0);
//}
//else {
// RankID_in_MPIworld = ct;
//}
////GroupID_in_MPIworld
//label = "/DistributedFileInfo/GroupIDinMPIworld";
//if ( !(tpCntl.getInspectedValue(label, &ct )) ) {
// Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
// Exit(0);
//}
//else {
// GroupID_in_MPIworld = ct;
//}
//Process <--- NodeInfo
nnode=0;
//label_base = "/DistributedFileInfo/NodeInfo";
label_base = "/Process";
if ( tpCntl.chkNode(label_base) ) //nodeがあれば
{
nnode = tpCntl.countLabels(label_base);
}
NodeInfoSize=nnode;
Node = new DfiInfo::NodeInfo[nnode];
for (int i=0; i<NodeInfoSize; i++)
{
if ( !(tpCntl.getNodeStr(label_base, i+1, str)) )
{
printf("\tParsing error : No Elem name\n");
Exit(0);
}
if( strcasecmp(str.substr(0,4).c_str(), "Rank") ) continue;
label_leaf=label_base+"/"+str;
//RankID
label = label_leaf + "/ID";
if ( !(tpCntl.getInspectedValue(label, ct )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
else {
Node[i].RankID= ct;
}
//HostName
label = label_leaf + "/HostName";
if ( !(tpCntl.getInspectedValue(label, str )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n", label.c_str());