-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathIDocument.hpp
More file actions
56 lines (40 loc) · 1.29 KB
/
IDocument.hpp
File metadata and controls
56 lines (40 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#ifndef I_DOCUMENT_HPP
#define I_DOCUMENT_HPP
#include <string>
#include <vector>
#include "DocumentInfo.hpp"
namespace sdrl {
using Text = std::wstring;
using Paragraph = std::wstring;
using ParagraphList = std::vector<std::wstring>;
using TableInfoList = std::vector<TableInfo>;
using ImageInfoList = std::vector<ImageInfo>;
using SectionInfoList = std::vector<SectionInfo>;
class IDocument {
protected:
DocumentInfo _documentInfo;
std::wstring _errMsg;
bool _isOpened = false;
public:
virtual void open(const std::wstring& path) = 0;
virtual bool isOpened() const = 0;
public:
virtual Text allText() const = 0;
virtual const ParagraphList& paragraphList() const = 0;
virtual const TableInfo& tableInfo(size_t index) const = 0;
virtual const TableInfoList& tableInfoList() const = 0;
virtual const ImageInfo& imageInfo(size_t index) const = 0;
virtual const ImageInfoList& imageInfoList() const = 0;
virtual const SectionInfo& sectionInfo(size_t index) const = 0;
virtual const SectionInfoList& sectionInfoList() const = 0;
public:
const DocumentInfo& documentInfo() const { return _documentInfo; }
const std::wstring& errorText() const { return _errMsg; }
operator bool() {
return isOpened();
}
virtual ~IDocument() = default;
};
}
#endif