[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepimlibs/kxmlrpcclient
From: Frank Osterfeld <frank.osterfeld () kdemail ! net>
Date: 2007-06-16 20:07:04
Message-ID: 1182024424.224902.12210.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 676394 by osterfeld:
Do not install query.h header (it includes private classes only), move Result to \
query.cpp
M +1 -1 CMakeLists.txt
M +69 -34 query.cpp
M +4 -70 query.h
--- trunk/KDE/kdepimlibs/kxmlrpcclient/CMakeLists.txt #676393:676394
@@ -18,4 +18,4 @@
########### install files ###############
-install( FILES kxmlrpcclient_export.h client.h query.h DESTINATION \
${INCLUDE_INSTALL_DIR}/kxmlrpcclient ) +install( FILES kxmlrpcclient_export.h \
client.h DESTINATION ${INCLUDE_INSTALL_DIR}/kxmlrpcclient )
--- trunk/KDE/kdepimlibs/kxmlrpcclient/query.cpp #676393:676394
@@ -32,63 +32,98 @@
/**
@file
- Implementation of Result and Query
+ Implementation of Query
**/
-class Result::Private
+namespace KXmlRpc {
+
+/**
+ @brief
+ Result is an internal class that represents a response
+ from a XML-RPC server.
+
+ This is an internal class and is only used by Query.
+ @internal
+ */
+class Result
{
+ friend class Query;
+ friend class Query::Private;
+
public:
+ /**
+ Constructs a result.
+ */
+ Result();
+
+ /**
+ Destroys a result.
+ */
+ ~Result();
+
+ /**
+ Returns true if the method call succeeded, false
+ if there was an XML-RPC fault.
+
+ @see errorCode(), errorString()
+ */
+ bool success() const;
+
+ /**
+ Returns the error code of the fault.
+
+ @see success(), errorString()
+ */
+ int errorCode() const;
+
+ /**
+ Returns the error string that describes the fault.
+
+ @see success, errorCode()
+ */
+ QString errorString() const;
+
+ /**
+ Returns the data sent to us from the server.
+ */
+ QList<QVariant> data() const;
+
+ private:
bool mSuccess;
int mErrorCode;
QString mErrorString;
QList<QVariant> mData;
};
-Result::Result()
- : d( new Private )
-{
-}
+} // namespace KXmlRpcClient
-Result::Result( const Result &other )
- : d( new Private )
-{
- *d = *other.d;
-}
-Result &Result::operator=( const Result &other )
+KXmlRpc::Result::Result()
{
- if ( this == &other ) {
- return *this;
- }
-
- *d = *other.d;
-
- return *this;
}
-Result::~Result()
+KXmlRpc::Result::~Result()
{
- delete d;
}
-bool Result::success() const
+bool KXmlRpc::Result::success() const
{
- return d->mSuccess;
+ return mSuccess;
}
-int Result::errorCode() const
+int KXmlRpc::Result::errorCode() const
{
- return d->mErrorCode;
+ return mErrorCode;
}
-QString Result::errorString() const
+QString KXmlRpc::Result::errorString() const
{
- return d->mErrorString;
+ return mErrorString;
}
-QList<QVariant> Result::data() const
+QList<QVariant> KXmlRpc::Result::data() const
{
- return d->mData;
+ return mData;
}
//small macro taken from HTTP IOSlave
@@ -134,11 +169,11 @@
Result Query::Private::parseMessageResponse( const QDomDocument &doc ) const
{
Result response;
- response.d->mSuccess = true;
+ response.mSuccess = true;
QDomNode paramNode = doc.documentElement().firstChild().firstChild();
while ( !paramNode.isNull() ) {
- response.d->mData << demarshal( paramNode.firstChild().toElement() );
+ response.mData << demarshal( paramNode.firstChild().toElement() );
paramNode = paramNode.nextSibling();
}
@@ -148,12 +183,12 @@
Result Query::Private::parseFaultResponse( const QDomDocument &doc ) const
{
Result response;
- response.d->mSuccess = false;
+ response.mSuccess = false;
QDomNode errorNode = doc.documentElement().firstChild().firstChild();
const QVariant errorVariant = demarshal( errorNode.toElement() );
- response.d->mErrorCode = errorVariant.toMap() [ "faultCode" ].toInt();
- response.d->mErrorString = errorVariant.toMap() [ "faultString" ].toString();
+ response.mErrorCode = errorVariant.toMap() [ "faultCode" ].toInt();
+ response.mErrorString = errorVariant.toMap() [ "faultString" ].toString();
return response;
}
--- trunk/KDE/kdepimlibs/kxmlrpcclient/query.h #676393:676394
@@ -21,14 +21,14 @@
#ifndef KXML_RPC_QUERY_H
#define KXML_RPC_QUERY_H
+#include "kxmlrpcclient_export.h"
+
#include <QtCore/QList>
#include <QtCore/QObject>
#include <QtCore/QVariant>
#include <QtCore/QMap>
#include <kio/job.h>
-#include "kxmlrpcclient_export.h"
-
class QString;
/** Namespace for XmlRpc related classes */
@@ -38,7 +38,7 @@
@brief
Query is a class that represents an individual XML-RPC call.
- This is an internal class and is only used by the KXmlRpc::Server class.
+ This is an internal class and is only used by the KXmlRpc::Client class.
@internal
*/
class KXMLRPCCLIENT_EXPORT Query : public QObject
@@ -86,7 +86,7 @@
void finished( Query * );
private:
- Query( const QVariant &id, QObject *parent = 0 );
+ explicit Query( const QVariant &id, QObject *parent = 0 );
~Query();
class Private;
@@ -96,72 +96,6 @@
Q_PRIVATE_SLOT( d, void slotResult( KJob * ) )
};
-/**
- @brief
- Result is an internal class that represents a response
- from a XML-RPC server.
-
- This is an internal class and is only used by Query.
- @internal
- */
-class Result
-{
- friend class Query;
- friend class Query::Private;
-
- public:
- /**
- Constructs a result.
- */
- Result();
-
- /**
- Constructs a result based on another result.
- */
- Result( const Result &other );
-
- /**
- Destroys a result.
- */
- ~Result();
-
- /**
- Assigns the values of one result to this one.
- */
- Result &operator=( const Result &other );
-
- /**
- Returns true if the method call succeeded, false
- if there was an XML-RPC fault.
-
- @see errorCode(), errorString()
- */
- bool success() const;
-
- /**
- Returns the error code of the fault.
-
- @see success(), errorString()
- */
- int errorCode() const;
-
- /**
- Returns the error string that describes the fault.
-
- @see success, errorCode()
- */
- QString errorString() const;
-
- /**
- Returns the data sent to us from the server.
- */
- QList<QVariant> data() const;
-
- private:
- class Private;
- Private *const d;
-};
-
} // namespace XmlRpc
#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic