⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addnewfiles.cpp

📁 把html转成txt 把html转成txt
💻 CPP
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include <vector>
#include <map>
#include "Document.h"
#include "AddNewFiles.h"
#include "../ExtensionToFormatMap.h"
#include "TFilePropertiesForm.h"


//---------------------------------------------------------------------------
#pragma package(smart_init)

bool AddNewFiles(Documents &newDocuments)
{
  DoxEngine::ExtensionToFormatMap extensionMap;

  // Get the last saved settings here
  FilePropertiesForm->LoadOptions();

  if (newDocuments.size() > 1)
    FilePropertiesForm->SetMultiFile(true);
  else
    FilePropertiesForm->SetMultiFile(false);



  if (FilePropertiesForm->ShowModal() == mrOk)
  {
    FileFormat outFormat
      = extensionMap[FilePropertiesForm->OutputFormatSelect->Text.LowerCase().c_str()];

    Documents::iterator i;

    for (i=newDocuments.begin();i!=newDocuments.end();i++)
    {
      // Input pathname already set


      i->SetOutputFormat(outFormat);

      // There is probably a better object oriented way to do this but... oh well
      if (!FilePropertiesForm->AutomaticFilenameSelect->Checked)
      {
        // Manual filename
        i->SetOutputManual(FilePropertiesForm->OutputFilenameEdit->Text.c_str());

      }
      else // Automatic filename
      {
        if(FilePropertiesForm->InputDirectorySelect->Checked)
          i->SetOutputAutomatic();
        else if (FilePropertiesForm->OutputDirectorySelect->Checked)
          i->SetOutputAutomatic(FilePropertiesForm->OutputDirectoryEdit->Text);
      }
      // Save the last settings here
      FilePropertiesForm->SaveOptions();
    }
    return true;
  }
  else
  {
    newDocuments.clear();
    return false;
  }



} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -