V-Gears 0
Free Final Fantasy VII engine.
DecompilerException.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#pragma once
17
18#include <exception>
19#include <string>
20
21class DecompilerException : public std::exception{};
22
30
37
38 public:
39
44};
45
52
53 public:
54
59};
60
67
68 public:
69
74};
75
82
83 public:
84
90 explicit UnknownOpcodeParameterException(std::string param);
91
97 virtual const char *what() const noexcept override;
98
99 private:
100
104 std::string what_;
105};
106
113
114 public:
115
122 UnknownConditionalOperatorException(unsigned int address, unsigned int op);
123
129 virtual const char *what() const noexcept override;
130
131 private:
132
136 std::string what_;
137};
138
145
146 public:
147
154 UnknownOpcodeException(unsigned int address, unsigned int opcode);
155
161 virtual const char* what() const noexcept override;
162
163 private:
164
170 virtual const char* Type() const;
171
175 unsigned int address_;
176
180 unsigned int opcode_;
181
185 mutable char buffer_[255];
186};
187
195
196 public:
197
204 UnknownJumpTypeException(unsigned int address, unsigned int opcode);
205
211 virtual const char* what() const noexcept override;
212
213 private:
214
218 std::string what_;
219};
220
227
228 public:
229
236 UnknownSubOpcodeException(unsigned int address, unsigned int opcode);
237
238 private:
239
245 virtual const char* Type() const override;
246
247};
Definition: DecompilerException.h:21
Not implemented exception.
Definition: DecompilerException.h:36
NotImplementedException()=default
Constructor.
Invalid header exception.
Definition: DecompilerException.h:51
ScriptHeaderInvalidException()=default
Constructor.
Unknown bank exception.
Definition: DecompilerException.h:66
UnknownBankException()=default
Constructor.
Unknown conditional operator exception.
Definition: DecompilerException.h:112
std::string what_
The error message.
Definition: DecompilerException.h:136
UnknownConditionalOperatorException(unsigned int address, unsigned int op)
Constructor.
Definition: DecompilerException.cpp:25
virtual const char * what() const noexcept override
Produces an error message.
Definition: DecompilerException.cpp:32
Unknown jump type exception.
Definition: DecompilerException.h:194
virtual const char * what() const noexcept override
Produces an error message.
Definition: DecompilerException.cpp:49
std::string what_
The error message.
Definition: DecompilerException.h:218
UnknownJumpTypeException(unsigned int address, unsigned int opcode)
Constructor.
Definition: DecompilerException.cpp:44
Unknown opcode exception.
Definition: DecompilerException.h:144
unsigned int opcode_
The value of the invalid opcode.
Definition: DecompilerException.h:180
char buffer_[255]
Buffer for formatting the error message.
Definition: DecompilerException.h:185
virtual const char * Type() const
Retrieves an exception identifier.
Definition: DecompilerException.cpp:42
virtual const char * what() const noexcept override
Produces an error message.
Definition: DecompilerException.cpp:37
UnknownOpcodeException(unsigned int address, unsigned int opcode)
Constructor.
Definition: DecompilerException.cpp:34
unsigned int address_
Address where the invalid opcode was found.
Definition: DecompilerException.h:175
Unknown opcode parameter exception.
Definition: DecompilerException.h:81
UnknownOpcodeParameterException(std::string param)
Constructor.
Definition: DecompilerException.cpp:19
virtual const char * what() const noexcept override
Produces an error message.
Definition: DecompilerException.cpp:23
std::string what_
The error message.
Definition: DecompilerException.h:104
Unknown subopcode exception.
Definition: DecompilerException.h:226
virtual const char * Type() const override
Retrieves an exception identifier.
Definition: DecompilerException.cpp:54
UnknownSubOpcodeException(unsigned int address, unsigned int opcode)
Constructor.
Definition: DecompilerException.cpp:51
Wrong type exception.
Definition: DecompilerException.h:29