Babel  1
The voip software that only works on your local network
Loading...
Searching...
No Matches
No.cpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2024
3** rtype (Workspace)
4** File description:
5** No.cpp
6*/
7
15
16namespace CustomExceptions
17{
18
19 NoFlagParameter::NoFlagParameter(const std::string &error)
20 {
21 _msg = "Error: There is no parameter passed to the flag.\n";
22 _msg += "The concerned flag is: ";
23 _msg += error;
24 _buffer = _msg.c_str();
25 };
26
28
29 const char *NoFlagParameter::what() const noexcept
30 {
31 return _buffer;
32 }
33
34 NoTOML::NoTOML(const std::string &tomlPath)
35 {
36 _msg = "Error: There is no configuration for the default font in the toml's configuration file ";
37 if (!tomlPath.empty()) {
38 _msg += "path " + tomlPath + " ";
39 }
40 _msg += "that is set to be used.";
41 _buffer = _msg.c_str();
42 };
43
45
46 const char *NoTOML::what() const noexcept
47 {
48 return _buffer;
49 }
50
51 NoTOMLKey::NoTOMLKey(const std::string &tomlPath, const std::string &tomlKey)
52 {
53 _msg = "Error: There is no toml ";
54 if (!tomlKey.empty()) {
55 _msg += "key '" + tomlKey + "'";
56 if (!tomlPath.empty()) {
57 _msg += " in the toml path " + tomlPath + " ";
58 }
59 }
60 _msg += "set to be used.";
61 _buffer = _msg.c_str();
62 };
63
65
66 const char *NoTOMLKey::what() const noexcept
67 {
68 return _buffer;
69 }
70
71 NoActiveNetwork::NoActiveNetwork(const std::string &exceptionDetails)
72 {
73 _msg = "Error: There is no running network to use for the function you called.\n";
74 if (!exceptionDetails.empty()) {
75 _msg += "Additional details: (" + exceptionDetails + ")";
76 }
77 _buffer = _msg.c_str();
78 };
79
81
82 const char *NoActiveNetwork::what() const noexcept
83 {
84 return _buffer;
85 }
86
87 NoAddressManager::NoAddressManager(const std::string &exceptionDetails)
88 {
89 _msg = "Error: There is no active address manager class to hold the connection information of the program.\n";
90 if (!exceptionDetails.empty()) {
91 _msg += "Additional details: (" + exceptionDetails + ")";
92 }
93 _buffer = _msg.c_str();
94 };
95
97
98 const char *NoAddressManager::what() const noexcept
99 {
100 return _buffer;
101 }
102
103 NoNetworkClass::NoNetworkClass(const std::string &exceptionDetails)
104 {
105 _msg = "Error: There is no network class to be passed\n";
106 if (!exceptionDetails.empty()) {
107 _msg += "Additional details: (" + exceptionDetails + ")";
108 }
109 _buffer = _msg.c_str();
110 };
111
113
114 const char *NoNetworkClass::what() const noexcept
115 {
116 return _buffer;
117 }
118
119 NoAudioStream::NoAudioStream(const std::string &exceptionDetails)
120 {
121 _msg = "Error: There is no audio stream available.\n";
122 if (!exceptionDetails.empty()) {
123 _msg += "Additional details: (" + exceptionDetails + ")";
124 }
125 _buffer = _msg.c_str();
126 };
127
129
130 const char *NoAudioStream::what() const noexcept
131 {
132 return _buffer;
133 }
134
135 NoCompressedAudio::NoCompressedAudio(const std::string &exceptionDetails)
136 {
137 _msg = "Error: There is no compressed audio data available.\n";
138 if (!exceptionDetails.empty()) {
139 _msg += "Additional details: (" + exceptionDetails + ")";
140 }
141 _buffer = _msg.c_str();
142 };
143
145
146 const char *NoCompressedAudio::what() const noexcept
147 {
148 return _buffer;
149 }
150
151 NoAudioPacket::NoAudioPacket(const std::string &exceptionDetails)
152 {
153 _msg = "Error: There is no audio packet available.\n";
154 if (!exceptionDetails.empty()) {
155 _msg += "Additional details: (" + exceptionDetails + ")";
156 }
157 _buffer = _msg.c_str();
158 };
159
161
162 const char *NoAudioPacket::what() const noexcept
163 {
164 return _buffer;
165 }
166}
This file contains the definitions of custom exception classes used to inform the user about missing ...
const char * what() const noexcept
Retrieves the error message.
Definition No.cpp:82
NoActiveNetwork(const std::string &exceptionDetails="")
Construct a new NoActiveNetwork object.
Definition No.cpp:71
const char * what() const noexcept
Retrieves the error message.
Definition No.cpp:98
NoAddressManager(const std::string &exceptionDetails="")
Construct a new NoAddressManager object.
Definition No.cpp:87
const char * what() const noexcept
Retrieves the error message.
Definition No.cpp:162
~NoAudioPacket()
Destroy the NoAudioPacket object.
Definition No.cpp:160
NoAudioPacket(const std::string &exceptionDetails="")
Construct a new NoAudioPacket object.
Definition No.cpp:151
~NoAudioStream()
Destroy the NoAudioStream object.
Definition No.cpp:128
const char * what() const noexcept
Retrieves the error message.
Definition No.cpp:130
NoAudioStream(const std::string &exceptionDetails="")
Construct a new NoAudioStream object.
Definition No.cpp:119
~NoCompressedAudio()
Destroy the NoCompressedAudio object.
Definition No.cpp:144
const char * what() const noexcept
Retrieves the error message.
Definition No.cpp:146
NoCompressedAudio(const std::string &exceptionDetails="")
Construct a new NoCompressedAudio object.
Definition No.cpp:135
const char * what() const noexcept
Retrieves the error message.
Definition No.cpp:29
NoFlagParameter(const std::string &error="")
Construct a new NoFlagParameter object.
Definition No.cpp:19
~NoFlagParameter()
Destroy the NoFlagParameter object.
Definition No.cpp:27
NoNetworkClass(const std::string &exceptionDetails="")
Construct a new NoNetworkClass object.
Definition No.cpp:103
const char * what() const noexcept
Retrieves the error message.
Definition No.cpp:114
const char * what() const noexcept
Retrieves the error message.
Definition No.cpp:66
~NoTOMLKey()
Destroy the NoTOMLKey object.
Definition No.cpp:64
NoTOMLKey(const std::string &tomlPath="", const std::string &tomlKey="")
Construct a new NoTOMLKey object.
Definition No.cpp:51
NoTOML(const std::string &tomlPath="")
Construct a new NoTOML object.
Definition No.cpp:34
~NoTOML()
Destroy the NoTOML object.
Definition No.cpp:44
const char * what() const noexcept
Retrieves the error message.
Definition No.cpp:46