Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

error.h

00001 /*
00002   Copyright (c) 2007-2008 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
00011 */
00012 
00013 #ifndef ERROR_H__
00014 #define ERROR_H__
00015 
00016 #include "gloox.h"
00017 #include "stanzaextension.h"
00018 
00019 #include <string>
00020 #include <map>
00021 
00022 namespace gloox
00023 {
00024 
00025   class Tag;
00026 
00034   class GLOOX_API Error : public StanzaExtension
00035   {
00036     public:
00037 
00038 //       Error()
00039 //         : StanzaExtension( ExtError ), m_type( StanzaErrorTypeUndefined ),
00040 //           m_error( StanzaErrorUndefined ), m_appError( 0 )
00041 //       {}
00042 
00047       Error( const Tag* tag = 0 );
00048 
00055       Error( StanzaErrorType type, StanzaError error, Tag* appError = 0 )
00056         : StanzaExtension( ExtError ), m_type( type ),
00057           m_error( error ), m_appError( appError )
00058       {}
00059 
00063       virtual ~Error();
00064 
00069       StanzaErrorType type() const { return m_type; }
00070 
00075       StanzaError error() const { return m_error; }
00076 
00083       const Tag* appError() const { return m_appError; }
00084 
00094       const std::string& text( const std::string& lang = "default" ) const;
00095 
00096       // reimplemented from StanzaExtension
00097       virtual const std::string& filterString() const;
00098 
00099       // reimplemented from StanzaExtension
00100       virtual StanzaExtension* newInstance( const Tag* tag ) const
00101       {
00102         return new Error( tag );
00103       }
00104 
00105       // reimplemented from StanzaExtension
00106       virtual Tag* tag() const;
00107 
00108     private:
00109       Error( const Error& error );
00110 
00111       void setValues( const Tag* tag );
00112       StanzaErrorType m_type;
00113       StanzaError m_error;
00114       Tag* m_appError;
00115       StringMap m_text;
00116   };
00117 
00118 }
00119 
00120 #endif /* ERROR_H__ */

Generated on Mon Jun 23 10:50:18 2008 for gloox by  doxygen 1.4.1