cli: Move most classes to shared lib for reuse

这个提交包含在:
2022-03-18 22:33:45 +01:00
父节点 d43c35819d
当前提交 478d57b342
共有 33 个文件被更改,包括 32 次插入44 次删除

34
shared/processor.h 普通文件
查看文件

@@ -0,0 +1,34 @@
#ifndef PROCESSOR_H
#define PROCESSOR_H
#include <QVector>
#include <QFile>
#include "pagedata.h"
#include "utils.h"
enum DataSource
{
FILEPATH,
ARRAY
};
#define NOTHING_PROCESSED 4
class Processor
{
public:
/* Indicates the data source the processor performs best with. For example,
* you do not want to read the entire of a compressed archive just to get the content of
* a single file */
DataSource PREFERED_DATA_SOURCE = ARRAY;
Processor();
virtual QVector<PageData> process(const QByteArray &data) const = 0;
virtual QVector<PageData> process(QString path) const
{
return process(Utils::readFile(path));
}
virtual ~Processor()
{
}
};
#endif // PROCESSOR_H