本文整理汇总了C++中TextParser::getInspectedValue方法的典型用法代码示例。如果您正苦于以下问题:C++ TextParser::getInspectedValue方法的具体用法?C++ TextParser::getInspectedValue怎么用?C++ TextParser::getInspectedValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextParser
的用法示例。
在下文中一共展示了TextParser::getInspectedValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadDfiFile
// #################################################################
//
void DfiInfo::ReadDfiFile(string fname)
{
TextParser tpCntl;
string str;
string label,label_base,label_leaf;
int ct;
REAL_TYPE ct2;
int nnode=0;
//入力ファイルをセット
int ierror = tpCntl.read(fname);
if ( ierror )
{
Hostonly_ stamped_printf("\tinput file not found '%s'\n",fname.c_str());
Exit(0);
}
//FileInfo
//Prefix
//label = "/DistributedFileInfo/Prefix";
label = "/FileInfo/Prefix";
if ( !(tpCntl.getInspectedValue(label, str )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
Prefix=str;
//FileFormat
//label = "/DistributedFileInfo/FileFormat";
label = "/FileInfo/FileFormat";
if ( !(tpCntl.getInspectedValue(label, str )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
FileFormat=str;
//GuideCell
//label = "/DistributedFileInfo/GuideCell";
label = "/FileInfo/GuideCell";
if ( !(tpCntl.getInspectedValue(label, ct )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
else {
GuideCell = ct;
}
//DataType
label = "/FileInfo/DataType";
if ( !(tpCntl.getInspectedValue(label, str )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
DataType=str;
//Endian
label = "/FileInfo/Endian";
if ( !(tpCntl.getInspectedValue(label, str )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
Endian=str;
//ArrayShape
label = "/FileInfo/ArrayShape";
if ( !(tpCntl.getInspectedValue(label, str )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
ArrayShape=str;
//Component
label = "/FileInfo/Component";
if ( !(tpCntl.getInspectedValue(label, ct )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
else {
Component = ct;
}
//Unit
//Length
label = "/Unit/Length";
if ( !(tpCntl.getInspectedValue(label, str )) )
{
//.........这里部分代码省略.........
示例2: ReadDfiProc
// #################################################################
//
void DfiInfo::ReadDfiProc(string fname)
{
TextParser tpCntl;
string str;
string label,label_base,label_leaf;
int ct;
int nnode=0;
int iv[3];
REAL_TYPE v[3];
//入力ファイルをセット
int ierror = tpCntl.read(fname);
if ( ierror )
{
Hostonly_ stamped_printf("\tinput file not found '%s'\n",fname.c_str());
Exit(0);
}
//Domain
//Global_Origin
label = "/Domain/GlobalOrigin";
for (int n=0; n<3; n++) v[n]=0.0;
if ( !(tpCntl.getInspectedVector(label, v, 3 )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
Global_Origin[0]=v[0];
Global_Origin[1]=v[1];
Global_Origin[2]=v[2];
//Global_Region
label = "/Domain/GlobalRegion";
for (int n=0; n<3; n++) v[n]=0.0;
if ( !(tpCntl.getInspectedVector(label, v, 3 )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
Global_Region[0]=v[0];
Global_Region[1]=v[1];
Global_Region[2]=v[2];
//Global_Voxel
label = "/Domain/GlobalVoxel";
for (int n=0; n<3; n++) iv[n]=0;
if ( !(tpCntl.getInspectedVector(label, iv, 3 )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
Global_Voxel[0]=iv[0];
Global_Voxel[1]=iv[1];
Global_Voxel[2]=iv[2];
//Global_Division
label = "/Domain/GlobalDivision";
for (int n=0; n<3; n++) iv[n]=0.0;
if ( !(tpCntl.getInspectedVector(label, iv, 3 )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
Global_Division[0]=iv[0];
Global_Division[1]=iv[1];
Global_Division[2]=iv[2];
//MPI
//NumberOfRank
label = "/MPI/NumberOfRank";
if ( !(tpCntl.getInspectedValue(label, ct )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
else {
NumberOfRank = ct;
}
//NumberOfGroup
label = "/MPI/NumberOfGroup";
if ( !(tpCntl.getInspectedValue(label, ct )) )
{
Hostonly_ stamped_printf("\tParsing error : fail to get '%s'\n",label.c_str());
Exit(0);
}
else {
NumberOfGroup = ct;
}
////RankID_in_MPIworld
//label = "/DistributedFileInfo/RankIDinMPIworld";
//.........这里部分代码省略.........