KD SOAP  2.0.0
KDSoapNamespacePrefixes_p.h
1 /****************************************************************************
2 **
3 ** This file is part of the KD Soap library.
4 **
5 ** SPDX-FileCopyrightText: 2010-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDAB-KDSoap OR LicenseRef-KDAB-KDSoap-US
8 **
9 ** Licensees holding valid commercial KD Soap licenses may use this file in
10 ** accordance with the KD Soap Commercial License Agreement provided with
11 ** the Software.
12 **
13 ** Contact info@kdab.com if any conditions of this licensing are not clear to you.
14 **
15 ****************************************************************************/
16 #ifndef KDSOAPNAMESPACEPREFIXES_P_H
17 #define KDSOAPNAMESPACEPREFIXES_P_H
18 
19 #include <QtCore/QMap>
20 #include <QtCore/QXmlStreamWriter>
21 
22 #include "KDSoapClientInterface.h"
23 #include "KDSoapMessageAddressingProperties.h"
24 
25 class KDSoapNamespacePrefixes : public QMap<QString /*ns*/, QString /*prefix*/>
26 {
27 public:
28  void writeStandardNamespaces(QXmlStreamWriter &writer, KDSoap::SoapVersion version = KDSoap::SOAP1_1, bool messageAddressingEnabled = false,
30  KDSoapMessageAddressingProperties::Addressing200508);
31 
32  void writeNamespace(QXmlStreamWriter &writer, const QString &ns, const QString &prefix)
33  {
34  // qDebug() << "writeNamespace" << ns << prefix;
35  insert(ns, prefix);
36  writer.writeNamespace(ns, prefix);
37  }
38  QString resolve(const QString &ns, const QString &localName) const
39  {
40  const QString prefix = value(ns);
41  if (prefix.isEmpty()) {
42  qWarning("ERROR: Namespace not found: %s (for localName %s)", qPrintable(ns), qPrintable(localName));
43  }
44  return prefix + QLatin1Char(':') + localName;
45  }
46 };
47 
48 #endif // KDSOAPNAMESPACESPREFIXES_H
QMap::value
const T value(const Key &key, const T &defaultValue) const const
KDSoapMessageAddressingProperties::KDSoapAddressingNamespace
KDSoapAddressingNamespace
Definition: KDSoapMessageAddressingProperties.h:107
QXmlStreamWriter::writeNamespace
void writeNamespace(const QString &namespaceUri, const QString &prefix)
QMap::insert
QMap::iterator insert(const Key &key, const T &value)
QString
QString::isEmpty
bool isEmpty() const const
QXmlStreamWriter
QMap
QLatin1Char

© 2010-2022 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 Fri Jul 22 2022 15:57:43 for KD SOAP by doxygen 1.8.20