Debian Codegraph @

Source/Control/Interface/SPARQL/CSPARQLXMLAnswerStreamingPrecompiledByteArraySerializer.h

raw
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #ifndef KONCLUDE_CONTROL_INTERFACE_OWLLINK_CSPARQLXMLANSWERSTREAMINGPRECOMPILEDBYTEARRAYSERIALIZER_H
22 #define KONCLUDE_CONTROL_INTERFACE_OWLLINK_CSPARQLXMLANSWERSTREAMINGPRECOMPILEDBYTEARRAYSERIALIZER_H
23
24 // Libraries includes
25 #include <QString>
26 #include <QXmlStreamWriter>
27 #include <QMap>
28 #include <QVector>
29 #include <QBuffer>
30
31 // Namespace includes
32 #include "CSPARQLXMLAnswerStreamingSerializer.h"
33
34 #include "Reasoner/Query/CVariableBindingsAnswersStreamingResult.h"
35 #include "Reasoner/Query/CVariableBindingsAnswersResult.h"
36 #include "Reasoner/Query/CBooleanQueryResult.h"
37 #include "Reasoner/Query/CVariableBindingStringResult.h"
38 #include "Reasoner/Query/CQueryStatistics.h"
39
40 #include "Reasoner/Kernel/Process/CProcessingStatistics.h"
41
42
43 // Other includes
44
45
46 // Logger includes
47 #include "Logger/CLogger.h"
48
49 using namespace Konclude::Logger;
50
51
52 namespace Konclude {
53
54 using namespace Reasoner::Query;
55 using namespace Reasoner::Kernel::Process;
56
57 namespace Control {
58
59 namespace Interface {
60
61 namespace SPARQL {
62
63 /*!
64 *
65 * \class CSPARQLXMLAnswerStreamingPrecompiledByteArraySerializer
66 * \author Andreas Steigmiller
67 * \version 0.1
68 * \brief TODO
69 *
70 */
71 class CSPARQLXMLAnswerStreamingPrecompiledByteArraySerializer : public CSPARQLXMLAnswerStreamingSerializer {
72 // public methods
73 public:
74 //! Constructor
75 CSPARQLXMLAnswerStreamingPrecompiledByteArraySerializer(QByteArray* buffer = nullptr, bool writeHeaderAndFooter = true);
76
77 //! Destructor
78 virtual ~CSPARQLXMLAnswerStreamingPrecompiledByteArraySerializer();
79
80
81 CSPARQLXMLAnswerStreamingPrecompiledByteArraySerializer* addResultStreamingBindingToTemporaryBuffer(const QStringList& varList, CVariableBindingsAnswerResult* bindings);
82
83 CSPARQLXMLAnswerStreamingPrecompiledByteArraySerializer* addTemporaryBuffer();
84 CSPARQLXMLAnswerStreamingPrecompiledByteArraySerializer* clearTemporaryBuffer();
85
86
87
88 CSPARQLXMLAnswerStreamingPrecompiledByteArraySerializer* writeFlush(cint64 flushNumber);
89
90
91 // protected methods
92 protected:
93 virtual CSPARQLXMLAnswerStreamingSerializer* writeResultStreamingStart();
94 virtual CSPARQLXMLAnswerStreamingSerializer* writeResultStreamingEnd();
95
96 CSPARQLXMLAnswerStreamingPrecompiledByteArraySerializer* writeUTF8String(const QString& string);
97 CSPARQLXMLAnswerStreamingPrecompiledByteArraySerializer* writeUTF8StringEscaped(const QString& string);
98
99
100 // protected variables
101 protected:
102 QByteArray mTemporaryBuffer;
103
104
105 QByteArray mResultsBegin;
106 QByteArray mResultsEnd;
107
108
109 QByteArray mResultBegin;
110 QByteArray mResultEnd;
111
112 QByteArray mBindingNameBegin;
113 QByteArray mBindingNameEnd;
114 QByteArray mBindingEnd;
115
116 QByteArray mUriBegin;
117 QByteArray mUriEnd;
118
119 QByteArray mBnodeBegin;
120 QByteArray mBnodeEnd;
121
122 QByteArray mLiteralDatatypeBegin;
123 QByteArray mLiteralDatatypeEnd;
124 QByteArray mLiteralEnd;
125 QByteArray mUnbound;
126
127 bool mConfAvoidStringCopying;
128
129
130 QString mDoubleQuoteEscapeString;
131 QString mSingleQuoteEscapeString;
132 QString mSmallerEscapeString;
133 QString mLargerEscapeString;
134 QString mAndEscapeString;
135
136 // private methods
137 private:
138
139 // private variables
140 private:
141
142 };
143
144 }; // end namespace SPARQL
145
146 }; // end namespace Interface
147
148 }; // end namespace Control
149
150 }; // end namespace Konclude
151
152 #endif // KONCLUDE_CONTROL_INTERFACE_OWLLINK_CSPARQLXMLANSWERSTREAMINGPRECOMPILEDBYTEARRAYSERIALIZER_H