本文整理汇总了C++中Directory::format方法的典型用法代码示例。如果您正苦于以下问题:C++ Directory::format方法的具体用法?C++ Directory::format怎么用?C++ Directory::format使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Directory
的用法示例。
在下文中一共展示了Directory::format方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createScriptEntry
static void createScriptEntry(Directory & container, MultipartStream * out, const char * objname, const char * member, bool mode = true)
{
string work;
string inib;
Directory * scope;
int i, j;
(*out) << container.format("\n\t\t/* [email protected] */\n\n");
if(mode)
{
scope = container.getFirstChild();
while(scope != 0)
{
work = scope->getKey();
if(work[0] < '0' || work[1] > '9')
(*out) << "\tOBJECT(" << container.getKey() << '_' << scope->toInteger() << ',' << work << ");\n";
scope = scope->getNext();
}
(*out) << container.format("\tEVAR(ID,_kernel_tmax_$(/prefix/[email protected]/id)id);\n");
}else
{
i = 0;
scope = container.getFirstChild();
while(scope != 0)
{
work = scope->getKey();
(*out) << "\tOBJECT(" << container.getKey() << '_' << (i++) << ',' << scope->getKey() << ");\n";
scope = scope->getNext();
}
(*out) << container.format("\tEVAR(ID,_kernel_tnum_$(/prefix/[email protected]/id)no);\n");
}
(*out) << container.format("\tEVAR($(/prefix/[email protected]/SID)INIB,_kernel_$(/prefix/[email protected]/sid)inib_table);\n");
work.assign(member);
i = 0;
j = work.find_first_of(',');
if(objname == NULL)
inib = container.getKey();
else
inib = objname;
do {
(*out) << "\tMEMBER(" << inib << "_initialization_block," << work.substr(i, j-i) << ");\n";
i = j + 1;
j = work.find_first_of(',', i);
} while(i != string::npos+1);
(*out) << '\n';
}