本文整理汇总了C++中CIFile::eof方法的典型用法代码示例。如果您正苦于以下问题:C++ CIFile::eof方法的具体用法?C++ CIFile::eof怎么用?C++ CIFile::eof使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIFile
的用法示例。
在下文中一共展示了CIFile::eof方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toLower
// ***************************************************************************
void makeAnimByRace(const std::string &animSetFile, const std::vector<string> &animList)
{
// *** Read the animset file.
CIFile iFile;
iFile.open(animSetFile, true);
// Read all text
static vector<string> animSetText;
animSetText.clear();
while(!iFile.eof())
{
char tmp[50000];
iFile.getline(tmp, 50000);
animSetText.push_back(tmp);
}
iFile.close();
bool someChangeDone= false;
// *** For each possible anim
for(uint i=0;i<animList.size();i++)
{
// get the possible anim file name (lowered)
static vector<string> raceAnimNames;
raceAnimNames.clear();
buildRaceAnimNames(raceAnimNames, toLower(CFile::getFilename(animList[i])));
// For each line of the animSet
uint lastStructLine= 0;
bool raceRestrictionFound= false;
for(uint j=0;j<animSetText.size();)
{
string line= animSetText[j];
string lineLwr= toLower(line);
// Find <LOG> TAg? => stop
if(line.find("<LOG>")!=string::npos)
break;
// Find a STRUCT start?
if(line.find("<STRUCT>")!=string::npos)
{
lastStructLine= j;
raceRestrictionFound= false;
}
// Find a RaceRestriction?
if( line.find("Name=\"Race Restriction\"")!=string::npos )
raceRestrictionFound= true;
// Find the anim name?
uint nameIndexInLine= findAnimName(lineLwr, raceAnimNames);
if(nameIndexInLine!=-1)
{
// Find the enclosing struct
nlassert(lastStructLine!=0);
uint startBlock= lastStructLine;
uint nameLineInBlock= j-startBlock;
uint endBlock= 0;
for(uint k=j+1;k<animSetText.size();k++)
{
string line= animSetText[k];
// Find a RaceRestriction?
if( line.find("Name=\"Race Restriction\"")!=string::npos )
raceRestrictionFound= true;
// end of block?
if(line.find("</STRUCT>")!=string::npos)
{
// endBlock is exclusive
endBlock= k+1;
break;
}
}
// if not found, abort
if(endBlock==0)
break;
// if a raceRestriction has been found, no op (already done)
if(raceRestrictionFound)
{
j= endBlock;
}
else
{
// LOG
InfoLog->displayRawNL("%s: Specifying %s by race",
CFile::getFilename(animSetFile).c_str(),
CFile::getFilename(animList[i]).c_str());
// *** Start a copy paste ^^
// Copy
static vector<string> copyText;
copyText.clear();
for(uint k=startBlock;k<endBlock;k++)
{
// add an empty line before </STRUCT>, for race selection node (filled later)
//.........这里部分代码省略.........