KD SOAP API Documentation 2.2
Loading...
Searching...
No Matches
KDSoapValue.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** This file is part of the KD Soap project.
4**
5** SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6**
7** SPDX-License-Identifier: MIT
8**
9****************************************************************************/
10#ifndef KDSOAPVALUE_H
11#define KDSOAPVALUE_H
12
13#include "KDSoapGlobal.h"
14#include <QtCore/QList>
15#include <QtCore/QPair>
16#include <QtCore/QSet>
17#include <QtCore/QSharedDataPointer>
18#include <QtCore/QString>
19#include <QtCore/QVariant>
20#include <QtCore/QVector>
21#include <QtCore/QXmlStreamNamespaceDeclarations>
22
23#ifndef QT_NO_STL
24#include <algorithm>
25#endif
26
27class KDSoapValueList;
29QT_BEGIN_NAMESPACE
31QT_END_NAMESPACE
32
33namespace KDSoap {
40{
44 SOAP1_2 = 2
45};
46}
47
60{
61public:
71
80 KDSoapValue(const QString &name, const QVariant &valueVariant, const QString &typeNameSpace = QString(), const QString &typeName = QString());
89 KDSoapValue(const QString &name, const KDSoapValueList &childValues, const QString &typeNameSpace = QString(),
90 const QString &typeName = QString());
91
95 KDSoapValue(const KDSoapValue &other);
96
101 {
102 if (this != &other) {
103 KDSoapValue copy(other);
104 swap(copy);
105 }
106 return *this;
107 }
108
112 void swap(KDSoapValue &other)
113 {
114 d.swap(other.d);
115 }
116
121 bool isNull() const;
122
128 bool isNil() const;
129
134 void setNillable(bool nillable);
135
139 QString name() const;
140
144 QString namespaceUri() const;
145
149 void setNamespaceUri(const QString &ns);
150
154 QVariant value() const;
155
159 void setValue(const QVariant &value);
160
166 bool isQualified() const;
167
180 void setQualified(bool qualified);
181
186 KDSoapValueList &childValues() const;
187
191 bool operator==(const KDSoapValue &other) const;
192
196 bool operator!=(const KDSoapValue &other) const;
197
212 void setType(const QString &nameSpace, const QString &type);
217 QString typeNs() const;
222 QString type() const;
223
228 void setNamespaceDeclarations(const QXmlStreamNamespaceDeclarations &namespaceDeclarations);
229
234 void addNamespaceDeclaration(const QXmlStreamNamespaceDeclaration &namespaceDeclaration);
235
240 QXmlStreamNamespaceDeclarations namespaceDeclarations() const;
241
246 void setEnvironmentNamespaceDeclarations(const QXmlStreamNamespaceDeclarations &environmentNamespaceDeclarations);
247
252 QXmlStreamNamespaceDeclarations environmentNamespaceDeclarations() const;
253
259 KDSoapValueList split() const;
260
265 enum Use
266 {
268 EncodedUse
269 };
270
271 QByteArray toXml(Use use = LiteralUse, const QString &messageNamespace = QString()) const;
272
273protected: // for KDSoapMessage
274 void setName(const QString &name);
275
276private:
277 // To catch mistakes
279
281 void writeElement(KDSoapNamespacePrefixes &namespacePrefixes, QXmlStreamWriter &writer, KDSoapValue::Use use, const QString &messageNamespace,
282 bool forceQualified) const;
283 void writeElementContents(KDSoapNamespacePrefixes &namespacePrefixes, QXmlStreamWriter &writer, KDSoapValue::Use use,
284 const QString &messageNamespace) const;
285 void writeChildren(KDSoapNamespacePrefixes &namespacePrefixes, QXmlStreamWriter &writer, KDSoapValue::Use use, const QString &messageNamespace,
286 bool forceQualified) const;
287
288 class Private;
290};
291
292QT_BEGIN_NAMESPACE
294QT_END_NAMESPACE
295
297
298KDSOAP_EXPORT uint qHash(const KDSoapValue &value);
299inline void qSwap(KDSoapValue &lhs, KDSoapValue &rhs)
300{
301 lhs.swap(rhs);
302}
303
304#ifndef QT_NO_STL
305namespace std {
306template<>
308{
309 lhs.swap(rhs);
310}
311}
312#endif
313
320class KDSOAP_EXPORT KDSoapValueList : public QList<KDSoapValue> // krazy:exclude=dpointer
321{
322public:
338 void addArgument(const QString &argumentName, const QVariant &argumentValue, const QString &typeNameSpace = QString(),
339 const QString &typeName = QString());
340
348 KDSoapValue child(const QString &name) const;
349
358 void setArrayType(const QString &nameSpace, const QString &type);
362 QString arrayTypeNs() const;
366 QString arrayType() const;
367
376 {
377 return m_attributes;
378 }
383 {
384 return m_attributes;
385 }
386
387private:
388 QPair<QString, QString> m_arrayType;
389 QList<KDSoapValue> m_attributes;
390
391 QVariant d; // for extensions
392};
393
395
396// Q_DECLARE_METATYPE(KDSoapValueList)
397
398#endif // KDSOAPVALUE_H
#define KDSOAP_EXPORT
QListIterator< KDSoapValue > KDSoapValueListIterator
void qSwap(KDSoapValue &lhs, KDSoapValue &rhs)
QT_END_NAMESPACE KDSOAP_EXPORT QDebug operator<<(QDebug dbg, const KDSoapValue &value)
KDSOAP_EXPORT uint qHash(const KDSoapValue &value)
QT_BEGIN_NAMESPACE Q_DECLARE_TYPEINFO(KDSoapValue, Q_MOVABLE_TYPE)
const QList< KDSoapValue > & attributes() const
QList< KDSoapValue > & attributes()
@ LiteralUse
data is serialized according to a given schema, no xsi:type attributes are written out
void swap(KDSoapValue &other)
KDSoapValue & operator=(const KDSoapValue &other)
void swap< KDSoapValue >(KDSoapValue &lhs, KDSoapValue &rhs)

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-soap/
Generated on Sat Apr 20 2024 00:04:25 for KD SOAP API Documentation by doxygen 1.9.8