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


C++ Filename::isDirectory方法代码示例

本文整理汇总了C++中Filename::isDirectory方法的典型用法代码示例。如果您正苦于以下问题:C++ Filename::isDirectory方法的具体用法?C++ Filename::isDirectory怎么用?C++ Filename::isDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Filename的用法示例。


在下文中一共展示了Filename::isDirectory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: extractInputArgs

bool ElmBatch::extractInputArgs(PlugInArgList* pInputArgList)
{
   if (ElmCore::extractInputArgs(pInputArgList) == false)
   {
      return false;
   }

   StepResource pStep("Extract Batch Input Args", "app", "32A136BE-8531-42ca-8B22-086293B5A925");
   VERIFY(pStep.get() != NULL);

   // Get the Use Gains/Offsets Flag.
   if (pInputArgList->getPlugInArgValue<bool>(UseGainsOffsetsArg(), mUseGainsOffsets) == false)
   {
      pStep->finalize(Message::Failure, "The \"" + UseGainsOffsetsArg() + "\" input arg is invalid.");
      if (mpProgress != NULL)
      {
         mpProgress->updateProgress(pStep->getFailureMessage(), 100, ERRORS);
      }

      return false;
   }

   if (mUseGainsOffsets == true)
   {
      // If the Use Gains/Offsets Flag is set to true, get the Gains/Offsets Filename.
      Filename* pFilename = pInputArgList->getPlugInArgValue<Filename>(GainsOffsetsFilenameArg());
      if (pFilename == NULL || pFilename->getFullPathAndName().empty() == true)
      {
         // If the Gains/Offsets Filename is not set, use the default.
         mGainsOffsetsFilename = getDefaultGainsOffsetsFilename();
      }
      else if (pFilename->isDirectory() == true)
      {
         pStep->finalize(Message::Failure, "The \"" + GainsOffsetsFilenameArg() + "\" cannot be a directory.");
         if (mpProgress != NULL)
         {
            mpProgress->updateProgress(pStep->getFailureMessage(), 100, ERRORS);
         }

         return false;
      }
      else
      {
         mGainsOffsetsFilename = pFilename->getFullPathAndName();
      }
   }
   else
   {
      // If the Use Gains/Offsets Flag is set to false, get the Signature Filenames and AOI Filenames.
      vector<Filename*> pSignatureFilenames;
      if (pInputArgList->getPlugInArgValue<vector<Filename*> >
         (SignatureFilenamesArg(), pSignatureFilenames) == false)
      {
         pStep->finalize(Message::Failure, "The \"" + SignatureFilenamesArg() + "\" input arg is invalid.");
         if (mpProgress != NULL)
         {
            mpProgress->updateProgress(pStep->getFailureMessage(), 100, ERRORS);
         }

         return false;
      }

      for (vector<Filename*>::iterator iter = pSignatureFilenames.begin(); iter != pSignatureFilenames.end(); ++iter)
      {
         bool previouslyLoaded;
         Signature* pSignature = dynamic_cast<Signature*>
            (getElement(*iter, "Signature", NULL, previouslyLoaded));
         if (pSignature == NULL)
         {
            pStep->finalize(Message::Failure, "The \"" + SignatureFilenamesArg() +
               "\" input arg contains an invalid value.");
            if (mpProgress != NULL)
            {
               mpProgress->updateProgress(pStep->getFailureMessage(), 100, ERRORS);
            }

            return false;
         }

         mpSignatures.push_back(pSignature);
         if (previouslyLoaded == false)
         {
            mpSignaturesToDestroy.push_back(pSignature);
         }
      }

      // Get the AOI names.
      vector<Filename*> pAoiFilenames;
      if (pInputArgList->getPlugInArgValue<vector<Filename*> >(AoiFilenamesArg(), pAoiFilenames) == false)
      {
         pStep->finalize(Message::Failure, "The \"" + AoiFilenamesArg() + "\" input arg is invalid.");
         if (mpProgress != NULL)
         {
            mpProgress->updateProgress(pStep->getFailureMessage(), 100, ERRORS);
         }

         return false;
      }

      for (vector<Filename*>::iterator iter = pAoiFilenames.begin(); iter != pAoiFilenames.end(); ++iter)
//.........这里部分代码省略.........
开发者ID:yuguess,项目名称:GSoC,代码行数:101,代码来源:ElmBatch.cpp


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