nexception.h

Go to the documentation of this file.
00001 // LICENSE: (Please see the file COPYING for details)
00002 //
00003 // NUS - Nemesis Utilities System: A C++ application development framework 
00004 // Copyright (C) 2006, 2007 Otavio Rodolfo Piske
00005 //
00006 //  This file is part of NUS
00007 //
00008 //  This library is free software; you can redistribute it and/or
00009 //  modify it under the terms of the GNU Lesser General Public
00010 //  License as published by the Free Software Foundation version 2.1
00011 //  of the License.
00012 //
00013 //  This library is distributed in the hope that it will be useful,
00014 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 //  Lesser General Public License for more details.
00017 //
00018 //  You should have received a copy of the GNU Lesser General Public
00019 //  License along with this library; if not, write to the Free Software
00020 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00021 //
00022 #ifndef NEXCEPTION_H
00023 #define NEXCEPTION_H
00024 
00029 #include "nstring.h"
00030 
00034 typedef nint32 Flag;
00035 
00039 class DllDeclSpec NException { 
00040       public:
00044             enum Module { 
00045                   NOT_SET,    
00046                   OS,         
00047                   BASE,       
00048                   BASEIO,     
00049                   OUTPUT,     
00050                   NETWORK,    
00051                   XML,        
00052                   SECURITY,   
00053                   DBAL,             
00054                   TOOLS,            
00055                   USERAPP,    
00056                   USERLIB           
00057             };
00058       
00062             static const Flag EX_NONE;
00063 
00067             static const Flag EX_OUT_OF_BOUNDS; 
00068 
00072             NException(void);
00073 
00080             NException(const NString &desc, Module module, Flag flag = EX_NONE);
00081 
00085             virtual ~NException(void);
00086             
00087             
00092             void setDescription(const NString &desc);
00093             
00098             NString getDescription(void) const;
00099             
00105             void setModule(Module module);
00106             
00111             NException::Module getModule(void) const;
00112             
00113             
00118             NException &operator=(const NException &other);
00119             
00120             
00125             void setFlag(Flag flag);
00130             Flag getFlag(void) const;
00131             
00132       protected:
00137             void setErrorId(nint16 error_id);
00138             
00139       private:
00140             NString m_description;
00141             Module m_module;
00142             Flag m_flag;
00143 };
00144 
00145 #endif // NEXCEPTION_H

Generated on Wed Mar 5 23:10:35 2008 for NemesisUtilitiesSystem by  doxygen 1.5.4