本文整理汇总了C++中CTokenizer::Delete方法的典型用法代码示例。如果您正苦于以下问题:C++ CTokenizer::Delete方法的具体用法?C++ CTokenizer::Delete怎么用?C++ CTokenizer::Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTokenizer
的用法示例。
在下文中一共展示了CTokenizer::Delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadASEHeader_Actual
//
// this actually reads XSI or GLA headers... historical mutation strikes again...
//
static void ReadASEHeader_Actual(LPCSTR psFilename, int &iStartFrame, int &iFrameCount, int &iFrameSpeed, bool bReadingGLA, bool bCanSkipXSIRead /* = false */)
{
// since the XSI loader is so damn slow and flakey I'm going to have to cache the info to avoid re-reading...
//
// do we have it in the cache?...
//
if (strstr(psFilename,".xsi") || strstr(psFilename,".XSI"))
{
ASECachedInfo_t::iterator iter = ASECachedInfo.find(psFilename);
if (iter != ASECachedInfo.end())
{
iStartFrame = 0;
iFrameCount = (*iter).second.first;
iFrameSpeed = (*iter).second.second;
return;
}
}
// is it a GLA file?...
//
if (bReadingGLA)
{
char sTemp[1024];
strcpy(sTemp,psFilename);
if (!(strstr(psFilename,".gla") || strstr(psFilename,".GLA")))
{
strcat(sTemp,".gla");
}
iStartFrame = 0;
iFrameCount = GLA_ReadHeader(sTemp);
iFrameSpeed = 20; // any old value for GLA file
return;
}
// it's not in the cache, but we may be able to avoid having to read it under some circumstances...
//
bool bXSIShouldBeRead = true;
if (gbCarWash_DoingScan)
{
bCanSkipXSIRead = false; // stop it asking the question
bXSIShouldBeRead= gbCarWash_YesToXSIScan;
}
if ( (strstr(psFilename,".xsi") || strstr(psFilename,".XSI"))
&& bCanSkipXSIRead
)
{
if (!gbSkipXSIRead && !gbSkipXSIRead_QuestionAsked)
{
gbSkipXSIRead_QuestionAsked = true;
gbSkipXSIRead = !GetYesNo(va("Model file: \"%s\"\n\n... is an XSI, and they can be damn slow to read in\n\nDo you want to scan all the XSIs?",psFilename));
}
bXSIShouldBeRead = !gbSkipXSIRead;
}
if (strstr(psFilename,".xsi") || strstr(psFilename,".XSI"))
{
if (bXSIShouldBeRead)
{
ReadXSIHeader(psFilename, iStartFrame, iFrameCount, iFrameSpeed);
if (iFrameCount!=0)
{
// cache it for future...
//
ASECachedInfo[psFilename] = FrameCountAndSpeed_t(iFrameCount,iFrameSpeed);
}
}
return;
}
// it must be an ASE file then instead....
//
CTokenizer* tokenizer = CTokenizer::Create();
tokenizer->AddParseFile(psFilename, ((CAssimilateApp*)AfxGetApp())->GetBufferSize());
tokenizer->SetSymbols(CSequence_s_Symbols);
tokenizer->SetKeywords(CSequence_s_Keywords);
CToken* curToken = tokenizer->GetToken();
while(curToken != NULL)
{
switch (curToken->GetType())
{
case TK_EOF:
curToken->Delete();
curToken = NULL;
break;
case TK_ASTERISK:
curToken->Delete();
curToken = tokenizer->GetToken();
switch(curToken->GetType())
{
//.........这里部分代码省略.........