Main Page   Class Hierarchy   Compound List   File List   Compound Members  

xrmethodresponse.h

00001 /*
00002 
00003 qutexrlib QT-based XML-RPC library
00004 Copyright (C) 2003  P. Oscar Boykin <boykin@pobox.com>
00005 
00006 This program is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU General Public License
00008 as published by the Free Software Foundation; either version 2
00009 of the License, or (at your option) any later version.
00010 
00011 This program is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with this program; if not, write to the Free Software
00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019    
00020  */
00021 
00022 #ifndef xrmethodresponse
00023 #define xrmethodresponse
00024 
00025 #include <qstring.h>
00026 #include <qvaluelist.h>
00027 #include <qvariant.h>
00028 #include <qdom.h>
00029 #include <xrvariant.h>
00030 
00037 class XRMethodResponse : public QDomDocument {
00038 
00039     public:
00045         XRMethodResponse();
00050         XRMethodResponse(const QVariant& result);
00057         XRMethodResponse(int faultCode, const QString& faultString);
00058         
00064         bool parseXmlRpc();
00065         
00071         bool getFault(int& faultCode, QString& faultString) const;
00072         
00077         const QVariant& getResponse() const { return _response; }
00078     protected:
00079         
00080         static void faultToDomDoc(int fault_code,
00081                                   const QString& fault_string,
00082                                   QDomDocument& doc);
00083         
00084         static bool fromDomDoc(const QDomDocument& doc,
00085                                QVariant& result,
00086                                bool& isFault);
00087                                
00088 
00089         /* This is NOT a fault */
00090         static void responseToDomDoc(const QVariant& result,
00091                                      QDomDocument& doc);
00092 
00093         bool _is_fault;
00094         int _fault_code;
00095         QString _fault_string;
00096         QVariant _response;
00097 };
00098 
00099 #endif

Generated on Tue Feb 25 18:38:57 2003 for qutexr by doxygen1.2.15