本文整理汇总了C++中Strng::FnDrivePath方法的典型用法代码示例。如果您正苦于以下问题:C++ Strng::FnDrivePath方法的具体用法?C++ Strng::FnDrivePath怎么用?C++ Strng::FnDrivePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Strng
的用法示例。
在下文中一共展示了Strng::FnDrivePath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckForInclude
BOOL CTokenFileInfo::CheckForInclude()
{
if (bUseIncludes && (pParser->sTokenLine[0]==sIncludeChars[0]))
{
CString FileName = pParser->sTokenLine;
if (pParser->sTokenLine.Find((const char*)sIncludeChars)==0)
{
FileName = FileName.Mid(sIncludeChars.GetLength(), 1024);
FileName = FileName.Right(FileName.GetLength() - FileName.SpanIncluding(" \t").GetLength());
while (FileName.GetLength()>0 && (FileName[FileName.GetLength()-1]==' ' || FileName[FileName.GetLength()-1]=='\t'))
FileName = FileName.Left(FileName.GetLength()-1);
BOOL Failed = TRUE;
DWORD ErrNo = 1;//file not specified
if (FileName.GetLength()>0)
{
if (FileName[0]=='\'' || FileName[0]=='"')
FileName = FileName.Right(FileName.GetLength() - 1);
int len = FileName.GetLength();
if (len>0)
{
if (FileName[len-1]=='\'' || FileName[len-1] == '"')
FileName = FileName.Left(len-1);
len = FileName.GetLength();
if (len>0)
{
iFileIndex++;
if (iFileIndex<TP_MaxIncludeFiles)
{
Strng Fn, FnFull;
Fn.FnDrivePath((char*)(const char*)FileName);
if (Fn()==NULL)
{// No Path Use Previous
Fn.FnDrivePath((char*)(const char*)FileNames[iFileIndex-1]);
Fn+=(char*)(const char*)FileName;
// FileName=Fn();
}
else
Fn=(char*)(const char*)FileName;
// CNM
if ((Fn[0]=='~') || (Fn[0]=='.')) // relative filename ?
{ // yes - prepend current folder (defined by previously openned file - NOT O/S
Strng T;
T.FnDrivePath((LPTSTR)(LPCTSTR)AllFileNames[iIncFileCnt-1]);
T+=Fn;
Fn=T;
}
FnFull.FnSearchExpand(Fn(), bFnPlaces);
Fn.FnContract();
FileName=Fn();
FileNames[iFileIndex] = Fn();
pParser->wLineNo--;
FileLineNo[iFileIndex] = 0;
Failed = !OpenFile(FnFull);
//File[iFileIndex] = fopen(FnFull(), "rt");
FnModifyTime(FnFull(), FileTimes[iFileIndex]);
if (iIncFileCnt<TP_MaxTtlIncludeFiles)
{
AllFileNames[iIncFileCnt]=Fn();
AllFileTimes[iIncFileCnt]=FileTimes[iFileIndex];
iIncFileCnt++;
}
if (Failed)
ErrNo = 2;//cannot open file
}
else
ErrNo = 3;//too many nested includes
}
}
}
if (Failed && pParser->pFailFn)
{
(*(pParser->pFailFn))((char*)(const char*)FileName, ErrNo, pParser->pFailExtraPtr);
}
return TRUE;
}
}
return FALSE;
}