当前位置: 首页>>代码示例>>C++>>正文


C++ Strng::FnDrivePath方法代码示例

本文整理汇总了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;
  }
开发者ID:abcweizhuo,项目名称:Test3,代码行数:85,代码来源:TKNPARS.CPP


注:本文中的Strng::FnDrivePath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。