本文整理汇总了C++中MCStack::findstackfile方法的典型用法代码示例。如果您正苦于以下问题:C++ MCStack::findstackfile方法的具体用法?C++ MCStack::findstackfile怎么用?C++ MCStack::findstackfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCStack
的用法示例。
在下文中一共展示了MCStack::findstackfile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
MCStack *MCDispatch::findstackname(const MCString &s)
{
if (s.getlength() == 0)
return NULL;
MCStack *tstk = stacks;
if (tstk != NULL)
{
do
{
MCStack *foundstk;
if ((foundstk = (MCStack *)tstk->findsubstackname(s)) != NULL)
return foundstk;
tstk = (MCStack *)tstk->next();
}
while (tstk != stacks);
}
tstk = stacks;
if (tstk != NULL)
{
do
{
MCStack *foundstk;
if ((foundstk = (MCStack *)tstk->findstackfile(s)) != NULL)
return foundstk;
tstk = (MCStack *)tstk->next();
}
while (tstk != stacks);
}
char *sname = s.clone();
if (loadfile(sname, tstk) != IO_NORMAL)
{
char *buffer = new char[s.getlength() + 5];
MCU_lower(buffer, s);
strcpy(&buffer[s.getlength()], ".mc");
delete sname;
char *sptr = buffer;
while (*sptr)
{
if (strchr("\r\n\t *?*<>/\\()[]{}|'`\"", *sptr) != NULL)
*sptr = '_';
sptr++;
}
if (loadfile(buffer, tstk) != IO_NORMAL)
{
strcpy(&buffer[s.getlength()], ".rev");
if (loadfile(buffer, tstk) != IO_NORMAL)
{
delete buffer;
return NULL;
}
}
delete buffer;
}
else
delete sname;
return tstk;
}