ADUL
Collection of reusable C++ utilities
Loading...
Searching...
No Matches
exceptions.hpp
Go to the documentation of this file.
1
2#ifndef ADUL_EXCEPTIONS_HPP
3#define ADUL_EXCEPTIONS_HPP
4
5#include <exception>
6#include <string>
7
13namespace adul::exceptions {
14 class Message;
15
16 class FailedXMLFile;
17 class FailedReadingXMLFile;
18 class FailedWritingXMLFile;
19}
20
27class adul::exceptions::Message : public std::exception {
28protected:
29 std::string msg = "!Error occurred! No info provided!\n";
30
31public:
32 Message() = default;
33 Message(const std::string&);
34 Message(const char*);
35 virtual const char* what() const noexcept override;
36};
37
43class adul::exceptions::FailedXMLFile : public std::exception {
44protected:
45 std::string msg = "Failed working with XML file";
46public:
47 FailedXMLFile() = default;
48 FailedXMLFile(const std::string& p_msg);
49 virtual const char* what() const noexcept override;
50};
51
52
58class adul::exceptions::FailedReadingXMLFile : public FailedXMLFile {
59public:
60 FailedReadingXMLFile(const std::string& p_msg);
63};
64
65
77
78
79#endif
represents failure with reading from XML file
Definition exceptions.hpp:58
FailedReadingXMLFile(const std::string &p_msg)
FailedReadingXMLFile(const FailedReadingXMLFile &)=default
FailedReadingXMLFile(FailedReadingXMLFile &&)=default
represents failure with writing to XML file
Definition exceptions.hpp:71
FailedWritingXMLFile(const std::string &p_msg)
FailedWritingXMLFile(FailedWritingXMLFile &&)=default
FailedWritingXMLFile(const FailedWritingXMLFile &)=default
represents failure with working with XML file
Definition exceptions.hpp:43
virtual const char * what() const noexcept override
FailedXMLFile(const std::string &p_msg)
modified std::exception class The only difference is that you define message by yourself when create...
Definition exceptions.hpp:27
Message(const std::string &)
std::string msg
Definition exceptions.hpp:29
virtual const char * what() const noexcept override
exceptions module
project api's namespace
Definition atm.hpp:4