WIP/outlineindex #41
39
shared/documentprocessresult.cpp
Normal file
39
shared/documentprocessresult.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
#include "documentprocessresult.h"
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const DocumentProcessResult &pd)
|
||||
{
|
||||
out << pd.pages.size();
|
||||
out << pd.outlines.size();
|
||||
for(const PageData &pd : pd.pages)
|
||||
{
|
||||
out << pd;
|
||||
}
|
||||
for(const DocumentOutlineEntry &outline : pd.outlines)
|
||||
{
|
||||
out << outline;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &in, DocumentProcessResult &pd)
|
||||
{
|
||||
int numPages, numOutlines;
|
||||
in >> numPages;
|
||||
in >> numOutlines;
|
||||
|
||||
for(int i = 0; i < numPages; i++)
|
||||
{
|
||||
PageData data;
|
||||
in >> data;
|
||||
pd.pages.append(data);
|
||||
}
|
||||
|
||||
for(int i = 0; i < numOutlines; i++)
|
||||
{
|
||||
DocumentOutlineEntry outline;
|
||||
in >> outline;
|
||||
pd.outlines.append(outline);
|
||||
}
|
||||
|
||||
return in;
|
||||
}
|
17
shared/documentprocessresult.h
Normal file
17
shared/documentprocessresult.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef DOCUMENTPROCESSRESULT_H
|
||||
#define DOCUMENTPROCESSRESULT_H
|
||||
#include <pagedata.h>
|
||||
#include <documentoutlineentry.h>
|
||||
|
||||
class DocumentProcessResult
|
||||
{
|
||||
public:
|
||||
QVector<PageData> pages;
|
||||
QVector<DocumentOutlineEntry> outlines;
|
||||
};
|
||||
Q_DECLARE_METATYPE(DocumentProcessResult);
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const DocumentProcessResult &pd);
|
||||
QDataStream &operator>>(QDataStream &in, DocumentProcessResult &pd);
|
||||
|
||||
#endif // DOCUMENTPROCESSRESULT_H
|
載入中…
新增問題並參考
Block a user