edbee - Qt Editor Library
textdocumentserializer.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <QString>
9 
10 class QIODevice;
11 
12 namespace edbee {
13 
14 class TextDocument;
15 class TextDocumentSerializer;
16 
18 {
19 public:
25  virtual bool saveLineSelector( TextDocumentSerializer* serializer, int lineIdx, QString& line ) = 0;
26 };
27 
28 
31 {
32 public:
33  TextDocumentSerializer( TextDocument* textDocument );
34 
35  bool load( QIODevice* ioDevice );
36  bool save( QIODevice* ioDevice );
37 
38 
39  QString errorString() { return errorString_; }
40  void setFilter( TextDocumentSerializerFilter* filter ) { filterRef_ = filter; }
41  TextDocumentSerializerFilter* filter() { return filterRef_; }
42 
43 private:
44  QString appendBufferToDocument(const QString& strIn);
45 
46 private:
47  TextDocument* textDocumentRef_;
48  int blockSize_;
49  QString errorString_;
50  TextDocumentSerializerFilter* filterRef_;
51 };
52 
53 } // edbee
This is the base and abstract class of a text document A TextDocument is the model part of the editor...
Definition: textdocument.h:40
virtual bool saveLineSelector(TextDocumentSerializer *serializer, int lineIdx, QString &line)=0
A special filter class to filter lines while saving.
A class used to load/save a text-file from and to an IODevice.
Definition: textdocumentserializer.h:30
void setFilter(TextDocumentSerializerFilter *filter)
Definition: textdocumentserializer.h:40
TextDocumentSerializerFilter * filter()
Definition: textdocumentserializer.h:41
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: commentcommand.cpp:22
QString errorString()
Definition: textdocumentserializer.h:39
Definition: textdocumentserializer.h:17