VVISF & VVGL
VVISF_Err.hpp
1 #ifndef ISFErr_h
2 #define ISFErr_h
3 
4 #include "VVISF_Base.hpp"
5 
6 
7 
8 
9 namespace VVISF
10 {
11 
12 
13 using namespace std;
14 
15 
20 enum ISFErrType {
32  ISFErrType_ErrorCompilingGLSL
33 };
34 
35 
40 class VVISF_EXPORT ISFErr {
41  public:
45  string general;
47  string specific;
49  map<string,string> details;
50  public:
51  ISFErr(const ISFErrType & inType, const char * inGeneral, const char * inSpecific, const map<string,string> & inDetails=map<string,string>()) : type(inType), general(inGeneral), specific(inSpecific), details(inDetails) {};
52  ISFErr(const ISFErrType & inType, const char * inGeneral, const string & inSpecific, const map<string,string> & inDetails=map<string,string>()) : type(inType), general(inGeneral), specific(inSpecific), details(inDetails) {};
53  ISFErr(const ISFErrType & inType, const string & inGeneral, const char * inSpecific, const map<string,string> & inDetails=map<string,string>()) : type(inType), general(inGeneral), specific(inSpecific), details(inDetails) {};
54  ISFErr(const ISFErrType & inType, const string & inGeneral, const string & inSpecific, const map<string,string> & inDetails=map<string,string>()) : type(inType), general(inGeneral), specific(inSpecific), details(inDetails) {};
55 
56  ISFErr(const ISFErr & n) = default;
57  ISFErr & operator=(const ISFErr & n) = default;
58 
60  string getTypeString() {
61  switch (type) {
62  case ISFErrType_Unknown:
63  return string("Unknown");
65  return string("Missing Resource");
67  return string("JSON error");
69  return string("Error loading");
71  return string("FS Error");
72  case ISFErrType_ErrorCompilingGLSL:
73  return string("GLSL Error");
74  }
75  return string("");
76  };
77 };
78 
79 
80 
81 
82 }
83 
84 
85 #endif /* ISFErr_h */
string getTypeString()
Returns a human-readable string describing the receiver&#39;s error.
Definition: VVISF_Err.hpp:60
ISFErrType
Enumerates the different kinds of ISF errors.
Definition: VVISF_Err.hpp:20
map< string, string > details
A map that offers a more structured way to store more information that describes the error...
Definition: VVISF_Err.hpp:49
An unknown error type.
Definition: VVISF_Err.hpp:22
There was an error parsing the JSON blob that defines the ISF file.
Definition: VVISF_Err.hpp:28
STL namespace.
Definition: ISFAttr.hpp:12
There was an error loading one of the resources required by the ISF file.
Definition: VVISF_Err.hpp:26
ISFErrType type
The type of the ISFErr.
Definition: VVISF_Err.hpp:43
There was an error compiling the ISF file&#39;s GLSL program. Consult the ISFErr&#39;s "details" map for more...
Definition: VVISF_Err.hpp:30
The JSON blob that defines the ISF file was malformed.
Definition: VVISF_Err.hpp:24
The base error class utilized by VVISF.
Definition: VVISF_Err.hpp:40
string specific
A string that describes the problem more specifically.
Definition: VVISF_Err.hpp:47
string general
A string that describes the general problem.
Definition: VVISF_Err.hpp:45