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 =========================================================================*/ 00022 #ifndef __vtkErrorCode_h 00023 #define __vtkErrorCode_h 00024 #include "vtkSystemIncludes.h" 00025 00026 // The superclass that all commands should be subclasses of 00027 class VTK_COMMON_EXPORT vtkErrorCode 00028 { 00029 public: 00030 static const char *GetStringFromErrorCode(unsigned long event); 00031 static unsigned long GetErrorCodeFromString(const char *event); 00032 00033 //BTX 00034 // all the currently defined error codes 00035 // developers can use -- vtkErrorCode::UserError + int to 00036 // specify their own errors. 00037 // if this list is adjusted, be sure to adjust vtkErrorCodeErrorStrings 00038 // in vtkErrorCode.cxx to match. 00039 enum ErrorIds { 00040 NoError = 0, 00041 FileNotFoundError, 00042 CannotOpenFileError, 00043 UnrecognizedFileTypeError, 00044 PrematureEndOfFileError, 00045 FileFormatError, 00046 NoFileNameError, 00047 OutOfDiskSpaceError, 00048 UnknownError, 00049 UserError = 1000 00050 }; 00051 //ETX 00052 }; 00053 00054 #endif /* __vtkErrorCode_h */ 00055