本文整理汇总了C++中Spawn::className方法的典型用法代码示例。如果您正苦于以下问题:C++ Spawn::className方法的具体用法?C++ Spawn::className怎么用?C++ Spawn::className使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spawn
的用法示例。
在下文中一共展示了Spawn::className方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
// level field
out <<
"<TD><INPUT type=\"text\" name=\"level\" size=\"2\" maxlength=\"2\""
" value=\"";
if (searchLevel)
out << searchLevel;
out << "\"/></TD>\n";
// race field
out << "<TD><INPUT type=\"text\" name=\"race\" value=\""
<< searchRace << "\"/></TD>\n";
// Class field
out << "<TD><SELECT name=\"class\" size=\"1\">\n";
out << "<OPTION value=\"0\"";
if (searchClass == 0)
cout << " selected";
out << ">Any</OPTION>\n";
// create a fake spawn to get class names
Spawn fakeSpawn;
// start at class value 1, and go until maximum known class value
for (int i = 1; i <= 32; ++i)
{
// set the fake spawns class
fakeSpawn.setClassVal(i);
out << "<OPTION value=\"" << i << "\"";
if (searchClass == i)
cout << " selected";
// output the name corresponding to the class value
out << ">" << fakeSpawn.className() << "</OPTION>\n";
}
out << "</SELECT></TD>\n";
// Submission button
out << "<TD><INPUT type=\"submit\" value=\"Search\"/></TD>\n";
// close the form
out <<
"</TR>\n"
"</TABLE>\n"
"</FORM>\n";
sdb = fopen (SPAWNFILE, "r");
if (sdb == NULL)
{
// display the error
out << "<H1>Unable to open file '" SPAWNFILE "' (errno = "
<< errno << ")</H1>\n";
// close the document
out << footer;
// nothing more can be done
exit(1);
}
QString spawnName;
QRegExp stripExp("[0-9]");
while (fread (&dbSpawn, sizeof(dbSpawnStruct), 1, sdb))
{