SUPER Space invader : Turbo edition DX - VS GOD 1.0.0
A simple space invader ripoff
cexception.h
Go to the documentation of this file.
1
21#ifndef CEXCEPTION_H
22#define CEXCEPTION_H
23
24#include <string>
25#include <iostream>
26#include <exception>
27
28#include "../tools/ieditable.h"
29#include "errcode.h"
30
35namespace nsException
36{
37
42class CException : public std::exception, public nsUtil::IEditable
43{
44
45public :
52 CException(const std::string& Libelle = std::string(), const unsigned CodErr = KNoExc);
53
58 virtual ~CException() override = default;
59
64 const std::string& GetLibelle() const;
65
70 unsigned GetCodErr() const;
71
76 virtual const char* what() const noexcept override;
77
78protected :
79 virtual std::ostream& _Edit(std::ostream& os = std::cerr) const override;
80
84 std::string m_Libelle;
85
89 unsigned m_CodErr;
90
91}; // class CException
92
93} // namespace nsException
94
95#include "cexception.hpp"
96
97#endif // CEXCEPTION_H
98
Classe pour créer des exceptions facilement.
Definition: cexception.h:43
virtual std::ostream & _Edit(std::ostream &os=std::cerr) const override
Fonction appelée pour injecter l'objet courant dans un flux.
virtual const char * what() const noexcept override
Retourne une chaine de caractère C décrivant l'exception.
Definition: cexception.hpp:43
virtual ~CException() override=default
Destructeur virtuel pour la classe CException.
unsigned m_CodErr
m_CodErr : Code erreur de l'exception
Definition: cexception.h:89
std::string m_Libelle
m_Libelle : Libellé de l'exception
Definition: cexception.h:84
unsigned GetCodErr() const
Récupère le code erreur de l'exception.
Definition: cexception.hpp:38
CException(const std::string &Libelle=std::string(), const unsigned CodErr=KNoExc)
Constructeur pour la classe CException.
Definition: cexception.hpp:28
const std::string & GetLibelle() const
Récupère le libellé de l'exception.
Definition: cexception.hpp:33
Interface pour un objet injectable.
Definition: ieditable.h:38
Codes d'erreurs.
Espace de nom pour la gestion d'exceptions.