-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.hpp
48 lines (42 loc) · 1015 Bytes
/
errors.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
** errors.hpp for Untitled (Workspace) in /home/xelium/2019/cpp/cpp_nanotekspice
**
** Made by alexis lopes
** Login <[email protected]>
**
** Started on Sat Feb 1 15:52:56 2020 alexis lopes
** Last update Fri Feb 13 12:45:24 AM 2020 Edouard.touch
*/
#ifndef ERRORS_HPP_
#define ERRORS_HPP_
#include <exception>
#include <string>
#include <iostream>
#include <fstream>
class Error : public std::exception
{
public:
Error(int numero = 0, std::string const &phrase = "", int niveau = 0) throw()
: m_numero(numero), m_phrase(phrase), m_niveau(niveau)
{
std::cerr << "\033[1;31m" << m_phrase << "\033[0m" << std::endl;
exit(84);
}
virtual const char *what() const throw()
{
return m_phrase.c_str();
}
int getNiveau() const throw()
{
return m_niveau;
}
virtual ~Error() throw()
{
}
private:
int m_numero;
std::string m_phrase;
int m_niveau;
};
void checkErrors(int, char **);
#endif /* !ERRORS_HPP_ */