00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkErrorCode.h,v $ 00005 Language: C++ 00006 00007 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00026 #ifndef __vtkErrorCode_h 00027 #define __vtkErrorCode_h 00028 00029 // The superclass that all commands should be subclasses of 00030 class vtkErrorCode 00031 { 00032 public: 00033 static const char *GetStringFromErrorCode(unsigned long event); 00034 static unsigned long GetErrorCodeFromString(const char *event); 00035 00036 //BTX 00037 // all the currently defined error codes 00038 // developers can use -- vtkErrorCode::UserError + int to 00039 // specify their own errors. 00040 // if this list is adjusted, be sure to adjust vtkErrorCodeErrorStrings 00041 // in vtkErrorCode.cxx to match. 00042 enum ErrorIds { 00043 NoError = 0, 00044 FileNotFoundError, 00045 CannotOpenFileError, 00046 UnrecognizedFileTypeError, 00047 PrematureEndOfFileError, 00048 FileFormatError, 00049 NoFileNameError, 00050 UnknownError, 00051 UserError = 1000 00052 }; 00053 //ETX 00054 }; 00055 00056 #endif /* __vtkErrorCode_h */ 00057