Albert S
aed0ca31f7
Detect mime types, and for text/*, run the default text processor. The added benefit is that we can now add plaintext files without extensions, or many other text files (e. g. source code).
26 строки
451 B
C++
26 строки
451 B
C++
#ifndef SANDBOXEDPROCESSOR_H
|
|
#define SANDBOXEDPROCESSOR_H
|
|
#include <QString>
|
|
#include <QMimeDatabase>
|
|
#include "pagedata.h"
|
|
|
|
class SandboxedProcessor
|
|
{
|
|
private:
|
|
QString filePath;
|
|
QMimeDatabase mimeDatabase;
|
|
|
|
void enableSandbox(QString readablePath = "");
|
|
void printResults(const QVector<PageData> &pageData);
|
|
|
|
public:
|
|
SandboxedProcessor(QString filepath)
|
|
{
|
|
this->filePath = filepath;
|
|
}
|
|
|
|
int process();
|
|
};
|
|
|
|
#endif // SANDBOXEDPROCESSOR_H
|