示例#1
0
bool Application::executeStartupBatchWizards()
{
   vector<string> wizardFiles;

   ArgumentList* pArgumentList = ArgumentList::instance();
   if (pArgumentList != NULL)
   {
      wizardFiles = pArgumentList->getOptions("input");
   }

   if (wizardFiles.empty() == true)
   {
      return true;
   }

   return WizardUtilities::runBatchFiles(wizardFiles, mpProgress);
}
示例#2
0
bool Application::generateXml()
{
   vector<string> files;

   ArgumentList* pArgumentList = ArgumentList::instance();
   if (pArgumentList != NULL)
   {
      files = pArgumentList->getOptions("generate");
   }

   for (vector<string>::iterator iter = files.begin(); iter != files.end(); ++iter)
   {
      string wizardFilename = *iter;

      auto_ptr<BatchWizard> pBatchWizard(WizardUtilities::createBatchWizardFromWizard(wizardFilename));
      if (pBatchWizard.get() != NULL)
      {
         vector<BatchWizard*> batchWizards;
         batchWizards.push_back(pBatchWizard.get());
         string outputFilename = WizardUtilities::deriveBatchWizardFilename(wizardFilename);
         if (!WizardUtilities::writeBatchWizard(batchWizards, outputFilename))
         {
            reportError("Cannot write out batch wizard file: " + outputFilename);
            return false;
         }
      }
      else
      {
         reportError("Could not create the batch wizard.  Make sure that the wizard file is valid, and that "
            "each value item in the wizard has a unique name.");
         return false;
      }
   }

   return true;
}