XmlRpcException.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002  
00003     Copyright (c) 2004 Media Development Loan Fund
00004   
00005     This file is part of the Campcaster project.
00006     https://www.campware.org/
00007     To report bugs, send an e-mail to [email protected]
00008   
00009     Campcaster is free software; you can redistribute it and/or modify
00010     it under the terms of the GNU General Public License as published by
00011     the Free Software Foundation; either version 2 of the License, or
00012     (at your option) any later version.
00013    
00014     Campcaster is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU General Public License for more details.
00018   
00019     You should have received a copy of the GNU General Public License
00020     along with Campcaster; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022   
00023   
00024     Author   : $Author: fgerlits $
00025     Version  : $Revision: 2872 $
00026     Location : $URL: svn://code.campware.org/campcaster/trunk/campcaster/src/modules/core/include/LiveSupport/Core/XmlRpcException.h $
00027  
00028 ------------------------------------------------------------------------------*/
00029 #ifndef LiveSupport_Core_XmlRpcException_h
00030  #define LiveSupport_Core_XmlRpcException_h
00031  
00032 #ifndef __cplusplus
00033  #error This is a C++ include file
00034  #endif
00035  
00036 
00037 /* ============================================================ include files */
00038 
00039 #ifdef HAVE_CONFIG_H
00040  #include "configure.h"
00041 #endif
00042  
00043 #include <stdexcept>
00044 
00045 #include "LiveSupport/Core/Ptr.h"
00046 
00047 namespace LiveSupport {
00048 namespace Core {
00049 
00050 
00051 /* ================================================================ constants */
00052 
00053 
00054 /* =================================================================== macros */
00055 
00056 
00057 /* =============================================================== data types */
00058 
00065 class XmlRpcException : public std::exception
00066 {
00067     private:
00071         Ptr<std::string>::Ref       message;
00072 
00076         const std::exception      & parent;
00077 
00078     public:
00084         XmlRpcException(const std::string &msg)             throw ()
00085                     : parent(*this)
00086         {
00087             message.reset(new std::string(msg));
00088         }
00089 
00095         XmlRpcException(const std::exception  & parent)     throw ()
00096                 : parent(parent)
00097         {
00098             message.reset(new std::string(parent.what()));
00099         }
00100 
00107         XmlRpcException(const std::string    & msg,
00108                         const std::exception & parent)      throw ();
00109 
00113         ~XmlRpcException(void)                              throw ()
00114         {
00115         }
00116 
00122         void
00123         setMessage(const std::string &      msg)            throw ()
00124         {
00125             message.reset(new std::string(msg));
00126         }
00127 
00133         virtual const char *
00134         what(void) const                                    throw ()
00135         {
00136             return message->c_str();
00137         }
00138 
00144         virtual const std::exception *
00145         getParent(void) const                               throw ()
00146         {
00147             return &parent == this ? 0 : &parent;
00148         }
00149 };
00150 
00151 
00152 /* ================================================= external data structures */
00153 
00154 
00155 /* ====================================================== function prototypes */
00156 
00157 
00158 } // namespace Core
00159 } // namespace LiveSupport
00160 
00161 #endif // LiveSupport_Core_XmlRpcException_h
00162  

Generated on Sat Sep 22 02:00:30 2007 for Campcaster by  1.4.7