本文整理汇总了C++中CStringArray::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ CStringArray::clear方法的具体用法?C++ CStringArray::clear怎么用?C++ CStringArray::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStringArray
的用法示例。
在下文中一共展示了CStringArray::clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
void ConditionalBGA::Load(const CString &szScreenName)
{
RageFile file;
CString szConditionalBGAFile = THEME->GetCurThemeDir() + szScreenName + " ConditionalBGA.ini";
// char filepath[512];
// strcpy(filepath,""); // empty the path first
// strcpy(filepath,szConditionalBGAFile.c_str());
LOG->Trace("ConditionalBGA Load:%s",szConditionalBGAFile.c_str());
bool loaded = file.Open(szConditionalBGAFile,RageFile::READ);
// FILE* fp = NULL;
// fp = fopen(filepath,"r");
if(!loaded)
{
LOG->Trace("ConditionalBGA File Not Found");
return;
}
else
{
CString currentline;
int bgano=0;
while(!file.AtEOF())
{
file.GetLine(currentline); // get the current line
// kill any possible comments
CStringArray asKillComments;
asKillComments.clear(); // get rid of anything in there
split(currentline, "#",asKillComments); // A comment starting with #
if(!asKillComments.empty())
{
currentline = asKillComments[0]; // there was some commentstuff here, take the first bit to be the actual data
}
asKillComments.clear(); // get rid of anything in there
split(currentline, "/",asKillComments); // A comment starting with // or /*
if(!asKillComments.empty())
{
currentline = asKillComments[0]; // there was some commentstuff here, take the first bit to be the actual data
}
TrimRight(currentline); // nuke trailing whitespace
// start parsing the data
if(currentline.c_str()[0] == '[') // we found a new bganimation
{
if(!m_bgainfo.empty()) // last one wasnt empty
{
CheckBgaRequirements(m_bgainfo[bgano]);
bgano++;
}
BgaCondInfo temp;
m_bgainfo.push_back(temp);
ClearINFO(bgano); // wipe out the old info structure.
CStringArray asSplitLine;
split(currentline,"[",asSplitLine);
split(asSplitLine[0],"]",asSplitLine);
if(!asSplitLine.empty() && asSplitLine.size() >= 1)
m_bgainfo[bgano].bganame = asSplitLine[asSplitLine.size() - 1];
}
else
{
CStringArray asSplitLine;
split(currentline,":",asSplitLine);
if(asSplitLine.empty()) continue;
if(!asSplitLine[0].CompareNoCase("clear") && asSplitLine.size() > 1)
{
if(!asSplitLine[1].CompareNoCase("true") || !asSplitLine[1].CompareNoCase("cleared") || !asSplitLine[1].CompareNoCase("clear")) // true / clear (any clear condition)
m_bgainfo[bgano].cleared = CBGA_CSCLEARED;
else if(!asSplitLine[1].CompareNoCase("false") || !asSplitLine[1].CompareNoCase("failed")) // false / failed
m_bgainfo[bgano].cleared = CBGA_CSFAILED;
else if(!asSplitLine[1].CompareNoCase("maxcombo") || !asSplitLine[1].CompareNoCase("fullcombo")) // passed with maxcombo
m_bgainfo[bgano].cleared = CBGA_CSMAXCOMBO;
else if(!asSplitLine[1].CompareNoCase("brokencombo")) // passed with a broken combo
m_bgainfo[bgano].cleared = CBGA_CSBROKECOMBO;
// LOG->Trace("Clear Conditon: %d",info.cleared);
}
if(!asSplitLine[0].CompareNoCase("songtitle") && asSplitLine.size() > 1)
{
m_bgainfo[bgano].songtitle = asSplitLine[1];
// LOG->Trace("SongTitle: %s",info.songtitle.c_str());
}
if(!asSplitLine[0].CompareNoCase("songartist") && asSplitLine.size() > 1)
{
m_bgainfo[bgano].songartist = asSplitLine[1];
// LOG->Trace("SongArtist: %s",info.songartist.c_str());
}
if(!asSplitLine[0].CompareNoCase("songday") && asSplitLine.size() > 1)
{
CStringArray asDays;
split( asSplitLine[1], ",", asDays );
for( unsigned d=0; d<asDays.size(); d++ )
{
int dn = atoi(asDays[d].c_str());
//.........这里部分代码省略.........