E:/Download/ois-1.0RC1/includes/OISException.h

Go to the documentation of this file.
00001 /*
00002 The zlib/libpng License
00003 
00004 Copyright (c) 2006 Phillip Castaneda (pjcast -- www.wreckedgames.com)
00005 
00006 This software is provided 'as-is', without any express or implied warranty. In no event will
00007 the authors be held liable for any damages arising from the use of this software.
00008 
00009 Permission is granted to anyone to use this software for any purpose, including commercial
00010 applications, and to alter it and redistribute it freely, subject to the following
00011 restrictions:
00012 
00013     1. The origin of this software must not be misrepresented; you must not claim that
00014                 you wrote the original software. If you use this software in a product,
00015                 an acknowledgment in the product documentation would be appreciated but is
00016                 not required.
00017 
00018     2. Altered source versions must be plainly marked as such, and must not be
00019                 misrepresented as being the original software.
00020 
00021     3. This notice may not be removed or altered from any source distribution.
00022 */
00023 #ifndef _OIS_EXCEPTION_HEADER_
00024 #define _OIS_EXCEPTION_HEADER_
00025 
00026 namespace OIS
00027 {
00029         enum _OISExport OIS_ERROR
00030         {
00031                 E_InputDisconnected,
00032                 E_InputDeviceNonExistant,
00033                 E_InputDeviceNotSupported,
00034                 E_DeviceFull,
00035                 E_NotSupported,
00036                 E_NotImplemented,
00037                 E_Duplicate,
00038                 E_InvalidParam,
00039                 E_General
00040         };
00041 
00047         class _OISExport Exception
00048         {
00050                 Exception() : eType(E_General), eLine(0), eFile(0) {}
00051         public:
00053                 Exception( OIS_ERROR err, const char* str, int line, const char *file )
00054                         : eType(err), eLine(line), eFile(file) ,eText(str) {}
00055 
00057                 const OIS_ERROR eType;
00059                 const int eLine;
00061                 const char* eFile;
00063                 const char* eText;
00064         };
00065 }
00066 
00068 #define OIS_EXCEPT( err, str ) throw( OIS::Exception(err, str, __LINE__, __FILE__) )
00069 
00070 #endif //_OIS_EXCEPTION_HEADER_

Generated on Sat Dec 1 20:13:51 2007 for OIS by  doxygen 1.5.4