OSDN Git Service

fixing document
[pheasant/hexedit.git] / src / control / document.h
1 #ifndef DOCUMENT_H_INC
2 #define DOCUMENT_H_INC
3
4 #include <QString>
5 #include <vector>
6
7 class DocumentImpl;
8 class QFile;
9
10
11 class Document
12 {
13 public:
14         Document();
15         Document(const QString &str, bool writemode);
16         Document(const Document &doc, bool writemode);
17         virtual ~Document();
18
19         quint64 length() const;
20
21         void get(quint64 pos, uint len, uchar *buf);
22         void insert(quint64 pos, const uchar *buf, uint len);
23
24 private:
25         void copy(uint type, quint64 pos, quint64 len, uchar *buf);
26
27
28 protected:
29         DocumentImpl *doc_;
30         QFile *file_;
31         std::vector<uchar> buffer_;
32
33 };
34
35
36 #endif