mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
34 lines
990 B
C++
34 lines
990 B
C++
#include <iostream>
|
||
|
||
#include "../Fb2File.h"
|
||
#include "../../DesktopEditor/common/File.h"
|
||
#include "../../DesktopEditor/common/Directory.h"
|
||
|
||
int main()
|
||
{
|
||
setlocale(LC_ALL, "Russian");
|
||
|
||
CFb2File oFile;
|
||
oFile.SetTmpDirectory(NSFile::GetProcessDirectory() + L"/tmp");
|
||
|
||
// файл, который открываем
|
||
std::wstring sFile = NSFile::GetProcessDirectory() + L"/../../../examples/1-posledneye-zhelaniye.fb2";
|
||
|
||
// директория, где будем создавать docx
|
||
std::wstring sOutputDirectory = NSFile::GetProcessDirectory() + L"/output";
|
||
if (!NSDirectory::Exists(sOutputDirectory))
|
||
NSDirectory::CreateDirectory(sOutputDirectory);
|
||
|
||
bool bCheck = oFile.IsFb2File(sFile);
|
||
if (!bCheck)
|
||
{
|
||
std::cout << "This isn't a fb2 file" << std::endl;
|
||
return 1;
|
||
}
|
||
|
||
int nResConvert = oFile.Convert(sFile, sOutputDirectory);
|
||
// GetText() ДЛЯ ТЕСТА
|
||
std::wcout << oFile.GetText();
|
||
return 0;
|
||
}
|