aboutsummaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2012-04-20 14:45:50 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2012-04-20 14:45:50 +0000
commit5940e91a4af209e7d3adbe90e98c4ff953993198 (patch)
treeca16245e6a6e26e1505bf35f2955de48d2647c07 /src/base
parent46cd5c8b9dc98e791198d1a3c744e24876c94f66 (diff)
downloadqxmpp-5940e91a4af209e7d3adbe90e98c4ff953993198.tar.gz
rename XMLRPC to QXmppRpcMarshaller
Diffstat (limited to 'src/base')
-rw-r--r--src/base/QXmppRpcIq.cpp16
-rw-r--r--src/base/QXmppRpcIq.h9
2 files changed, 13 insertions, 12 deletions
diff --git a/src/base/QXmppRpcIq.cpp b/src/base/QXmppRpcIq.cpp
index a2647077..adfc5db4 100644
--- a/src/base/QXmppRpcIq.cpp
+++ b/src/base/QXmppRpcIq.cpp
@@ -32,7 +32,7 @@
#include "QXmppRpcIq.h"
#include "QXmppUtils.h"
-void XMLRPC::marshall(QXmlStreamWriter *writer, const QVariant &value)
+void QXmppRpcMarshaller::marshall(QXmlStreamWriter *writer, const QVariant &value)
{
writer->writeStartElement("value");
switch( value.type() )
@@ -104,7 +104,7 @@ void XMLRPC::marshall(QXmlStreamWriter *writer, const QVariant &value)
writer->writeEndElement();
}
-QVariant XMLRPC::demarshall(const QDomElement &elem, QStringList &errors)
+QVariant QXmppRpcMarshaller::demarshall(const QDomElement &elem, QStringList &errors)
{
if ( elem.tagName().toLower() != "value" )
{
@@ -297,7 +297,7 @@ void QXmppRpcResponseIq::parseElementFromChild(const QDomElement &element)
while (!param.isNull())
{
QStringList errors;
- const QVariant value = XMLRPC::demarshall(param.firstChildElement("value"), errors);
+ const QVariant value = QXmppRpcMarshaller::demarshall(param.firstChildElement("value"), errors);
if (!errors.isEmpty())
break;
m_values << value;
@@ -308,7 +308,7 @@ void QXmppRpcResponseIq::parseElementFromChild(const QDomElement &element)
{
QStringList errors;
const QDomElement errElement = contents.firstChildElement("value");
- const QVariant error = XMLRPC::demarshall(errElement, errors);
+ const QVariant error = QXmppRpcMarshaller::demarshall(errElement, errors);
if (!errors.isEmpty())
return;
m_faultCode = error.toMap()["faultCode"].toInt();
@@ -328,7 +328,7 @@ void QXmppRpcResponseIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
QMap<QString,QVariant> fault;
fault["faultCode"] = m_faultCode;
fault["faultString"] = m_faultString;
- XMLRPC::marshall(writer, fault);
+ QXmppRpcMarshaller::marshall(writer, fault);
writer->writeEndElement();
}
else if (!m_values.isEmpty())
@@ -337,7 +337,7 @@ void QXmppRpcResponseIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
foreach (const QVariant &arg, m_values)
{
writer->writeStartElement("param");
- XMLRPC::marshall(writer, arg);
+ QXmppRpcMarshaller::marshall(writer, arg);
writer->writeEndElement();
}
writer->writeEndElement();
@@ -409,7 +409,7 @@ void QXmppRpcInvokeIq::parseElementFromChild(const QDomElement &element)
while (!param.isNull())
{
QStringList errors;
- QVariant arg = XMLRPC::demarshall(param.firstChildElement("value"), errors);
+ QVariant arg = QXmppRpcMarshaller::demarshall(param.firstChildElement("value"), errors);
if (!errors.isEmpty())
break;
m_arguments << arg;
@@ -431,7 +431,7 @@ void QXmppRpcInvokeIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
foreach(const QVariant &arg, m_arguments)
{
writer->writeStartElement("param");
- XMLRPC::marshall(writer, arg);
+ QXmppRpcMarshaller::marshall(writer, arg);
writer->writeEndElement();
}
writer->writeEndElement();
diff --git a/src/base/QXmppRpcIq.h b/src/base/QXmppRpcIq.h
index dda79a34..3b9e4792 100644
--- a/src/base/QXmppRpcIq.h
+++ b/src/base/QXmppRpcIq.h
@@ -31,11 +31,12 @@
class QXmlStreamWriter;
class QDomElement;
-namespace XMLRPC
+class QXMPP_EXPORT QXmppRpcMarshaller
{
- void marshall( QXmlStreamWriter *writer, const QVariant &value);
- QVariant demarshall(const QDomElement &elem, QStringList &errors);
-}
+public:
+ static void marshall( QXmlStreamWriter *writer, const QVariant &value);
+ static QVariant demarshall(const QDomElement &elem, QStringList &errors);
+};
/// \brief The QXmppRpcResponseIq class represents an IQ used to carry
/// an RPC response as specified by XEP-0009: Jabber-RPC.