STE-Industries: utilities testing
IntegerException.cpp
Go to the documentation of this file.
1 
14 # include "Graphic.h"
15 # include "IntegerException.h"
16 
17 # include <string.h>
18 
19 namespace GraphicSpace
20 {
21 
22 const char* const IntegerException::ErrorFormat =
23  "Input data error: %s %" PRIuFAST32 "\n";
24 
25 const char* const IntegerException::Message [] =
26  {
27  "invalid file size",
28  "invalid bitmap offset",
29  "invalid DIB header size",
30  "invalid image width",
31  "invalid image height",
32  "bitmap too large",
33  "invalid number of color planes",
34  "invalid number of bits per pixel",
35  "invalid value for compression",
36  "invalid image size",
37  "invalid number of colors",
38  "invalid number of important colors",
39  "invalid number of threads",
40  "invalid number of termites",
41  "invalid number of steps"
42  };
43 
56 
58  uint_fast32_t thisValue) noexcept: Exception(),
59  ExceptionKind(thisExceptionKind), Value(thisValue)
60  {
61  }
62 
83 
84 void IntegerException::Write(FILE* OutputFile) const noexcept
85  {
86  if (fprintf(OutputFile, ErrorFormat,
87  Message [static_cast<unsigned int>(ExceptionKind)], Value) < 0)
88  FatalError();
89  }
90 
91 }
GraphicSpace::Exception
Definition: Exception.h:29
GraphicSpace::IntegerException::ErrorFormat
static const char *const ErrorFormat
Definition: IntegerException.h:106
Graphic.h
GraphicSpace::IntegerExceptionType
IntegerExceptionType
Definition: IntegerException.h:35
GraphicSpace::IntegerException::Message
static const char *const Message[]
Definition: IntegerException.h:116
GraphicSpace::IntegerException::Write
void Write(FILE *OutputFile) const noexcept override
Definition: IntegerException.cpp:84
GraphicSpace
Definition: Bitmap.cpp:29
GraphicSpace::IntegerException::IntegerException
IntegerException(IntegerExceptionType thisExceptionKind, uint_fast32_t thisValue) noexcept
Definition: IntegerException.cpp:57
IntegerException.h