cli: Move most classes to shared lib for reuse

Tá an tiomantas seo le fáil i:
2022-03-18 22:33:45 +01:00
tuismitheoir d43c35819d
tiomantas 478d57b342
D'athraigh 33 comhad le 32 breiseanna agus 44 scriosta

26
shared/odtprocessor.cpp Comhad gnáth
Féach ar an gComhad

@ -0,0 +1,26 @@
#include <quazip5/quazip.h>
#include <quazip5/quazipfile.h>
#include "odtprocessor.h"
#include "tagstripperprocessor.h"
QVector<PageData> OdtProcessor::process(const QByteArray &data) const
{
throw LooqsGeneralException("Not implemented yet");
}
QVector<PageData> OdtProcessor::process(QString path) const
{
QuaZipFile zipFile(path);
zipFile.setFileName("content.xml");
if(!zipFile.open(QIODevice::ReadOnly))
{
throw LooqsGeneralException("Error while opening file " + path);
}
QByteArray entireContent = zipFile.readAll();
if(entireContent.isEmpty())
{
throw LooqsGeneralException("Error while reading content.xml of " + path);
}
TagStripperProcessor tsp;
return tsp.process(entireContent);
}