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