R-Type  2
Doom but in better
Loading...
Searching...
No Matches
Invalid.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2024
3** rtype (Workspace)
4** File description:
5** Invalid.hpp
6*/
7
14#pragma once
15
16#include <string>
17#include <exception>
18
19#include "Recoded.hpp"
20
21
22namespace CustomExceptions
23{
24
30 class InvalidIp : public std::exception {
31 public:
37 InvalidIp(const std::string &error = "");
42 ~InvalidIp();
47 const char *what() const noexcept;
48
49 private:
50 std::string _msg;
51 const char *_buffer;
52 };
53
59 class InvalidPort : public std::exception {
60 public:
66 InvalidPort(const std::string &error = "");
76 const char *what() const noexcept;
77
78 private:
79 std::string _msg;
80 const char *_buffer;
81 };
82
88 class InvalidFontConfiguration : public std::exception {
89 public:
96 InvalidFontConfiguration(const std::string &userConfiguration = "", const std::string &fontName = "");
106 const char *what() const noexcept;
107
108 private:
109 std::string _msg;
110 const char *_buffer;
111 };
112
118 class InvalidMusicConfiguration : public std::exception {
119 public:
126 InvalidMusicConfiguration(const std::string &userConfiguration = "", const std::string &musicName = "");
136 const char *what() const noexcept;
137
138 private:
139 std::string _msg;
140 const char *_buffer;
141 };
142
148 class InvalidSpriteConfiguration : public std::exception {
149 public:
157 InvalidSpriteConfiguration(const std::string &userConfiguration = "", const std::string &spriteName = "", const std::string &exceptionDetail = "");
167 const char *what() const noexcept;
168
169 private:
170 std::string _msg;
171 const char *_buffer;
172 };
173
179 class InvalidIconConfiguration : public std::exception {
180 public:
188 InvalidIconConfiguration(const std::string &tomlPath = "", const std::string &userConfiguration = "", const std::string &iconName = "", const std::string &exceptionDetail = "");
198 const char *what() const noexcept;
199
200 private:
201 std::string _msg;
202 const char *_buffer;
203 };
204
210 class InvalidBackgroundConfiguration : public std::exception {
211 public:
219 InvalidBackgroundConfiguration(const std::string &tomlPath = "", const std::string &userConfiguration = "", const std::string &backgroundName = "", const std::string &exceptionDetail = "");
229 const char *what() const noexcept;
230
231 private:
232 std::string _msg;
233 const char *_buffer;
234 };
235
241 class InvalidWindowWidth : public std::exception {
242 public:
248 InvalidWindowWidth(const std::string &argument = "");
258 const char *what() const noexcept;
259
260 private:
261 std::string _msg;
262 const char *_buffer;
263 };
264
270 class InvalidWindowX : public std::exception {
271 public:
277 InvalidWindowX(const std::string &argument = "");
287 const char *what() const noexcept;
288
289 private:
290 std::string _msg;
291 const char *_buffer;
292 };
293
299 class InvalidWindowY : public std::exception {
300 public:
306 InvalidWindowY(const std::string &argument = "");
316 const char *what() const noexcept;
317
318 private:
319 std::string _msg;
320 const char *_buffer;
321 };
322
328 class InvalidWindowHeight : public std::exception {
329 public:
335 InvalidWindowHeight(const std::string &argument = "");
345 const char *what() const noexcept;
346
347 private:
348 std::string _msg;
349 const char *_buffer;
350 };
351
357 class InvalidFrameLimit : public std::exception {
358 public:
364 InvalidFrameLimit(unsigned int frameLimit);
370 InvalidFrameLimit(const std::string &frameLimit);
380 const char *what() const noexcept;
381
382 private:
383 std::string _msg;
384 const char *_buffer;
385 };
386
394 class InvalidWidth : public std::exception {
395 public:
403 InvalidWidth(const std::string &width = "", const std::string &min = "", const std::string &max = "");
413 const char *what() const noexcept;
414
415 private:
416 std::string _msg;
417 const char *_buffer;
418 };
419
427 class InvalidHeight : public std::exception {
428 public:
436 InvalidHeight(const std::string &height = "", const std::string &min = "", const std::string &max = "");
446 const char *what() const noexcept;
447
448 private:
449 std::string _msg;
450 const char *_buffer;
451 };
452
458 class InvalidFontPath : public std::exception {
459 public:
465 InvalidFontPath(const std::string &path = "");
475 const char *what() const noexcept;
476
477 private:
478 std::string _msg;
479 const char *_buffer;
480 };
481
487 class InvalidShape : public std::exception {
488 public:
494 InvalidShape(const std::string &extraDetails = "");
504 const char *what() const noexcept;
505
506 private:
507 std::string _msg;
508 const char *_buffer;
509 };
510
517 class InvalidType : public std::exception {
518 public:
524 InvalidType(const std::string &extraDetails = "");
529 ~InvalidType();
534 const char *what() const noexcept;
535
536 private:
537 std::string _msg;
538 const char *_buffer;
539 };
540
546 class InvalidIndex : public std::exception {
547 public:
555 InvalidIndex(const std::string &index = "", const std::string &min = "", const std::string &max = "");
565 const char *what() const noexcept;
566
567 private:
568 std::string _msg;
569 const char *_buffer;
570 };
571
577 class InvalidDuration : public std::exception {
578 public:
586 InvalidDuration(const std::string &duration = "", const std::string &min = "", const std::string &max = "");
596 const char *what() const noexcept;
597
598 private:
599 std::string _msg;
600 const char *_buffer;
601 };
602
608 class InvalidTOML : public std::exception {
609 public:
616 InvalidTOML(const std::string &path = "", const std::string &error = "");
621 ~InvalidTOML();
626 const char *what() const noexcept;
627
628 private:
629 std::string _msg;
630 const char *_buffer;
631 };
632
639 class InvalidConfigurationSpritesheetType : public std::exception {
640 public:
649 InvalidConfigurationSpritesheetType(const std::string &path = "", const std::string &key = "", const std::string &type = "", const std::string &expectedType = "");
659 const char *what() const noexcept;
660
661 private:
662 std::string _msg;
663 const char *_buffer;
664 };
665
672 class InvalidConfigurationMusicType : public std::exception {
673 public:
682 InvalidConfigurationMusicType(const std::string &path = "", const std::string &key = "", const std::string &type = "", const std::string &expectedType = "");
692 const char *what() const noexcept;
693
694 private:
695 std::string _msg;
696 const char *_buffer;
697 };
698
705 class InvalidConfigurationFontType : public std::exception {
706 public:
715 InvalidConfigurationFontType(const std::string &path = "", const std::string &key = "", const std::string &type = "", const std::string &expectedType = "");
725 const char *what() const noexcept;
726
727 private:
728 std::string _msg;
729 const char *_buffer;
730 };
731
737 class InvalidTOMLKeyType : public std::exception {
738 public:
747 InvalidTOMLKeyType(const std::string &tomlPath = "", const std::string &tomlKey = "", const std::string &currentType = "", const std::string &expectedType = "");
757 const char *what() const noexcept;
758
759 private:
760 std::string _msg;
761 const char *_buffer;
762 };
763
764}
This is an agglomerator in which all the files from Recoded folder will be included.
This is the class in charge of informing the user that the background configuration they provided is ...
Definition Invalid.hpp:210
~InvalidBackgroundConfiguration()
Destroy the Invalid Sprite Configuration object.
Definition Invalid.cpp:165
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:167
InvalidBackgroundConfiguration(const std::string &tomlPath="", const std::string &userConfiguration="", const std::string &backgroundName="", const std::string &exceptionDetail="")
Construct a new Invalid Sprite Configuration object.
Definition Invalid.cpp:147
This is the class in charge of informing the user that the key type present in the file is of the wro...
Definition Invalid.hpp:705
InvalidConfigurationFontType(const std::string &path="", const std::string &key="", const std::string &type="", const std::string &expectedType="")
Construct a new Invalid Configuration Font Type object.
Definition Invalid.cpp:454
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:463
~InvalidConfigurationFontType()
Destroy the Invalid Configuration Font Type object.
Definition Invalid.cpp:461
This is the class in charge of informing the user that the key type present in the file is of the wro...
Definition Invalid.hpp:672
~InvalidConfigurationMusicType()
Destroy the Invalid Configuration Music Type object.
Definition Invalid.cpp:447
InvalidConfigurationMusicType(const std::string &path="", const std::string &key="", const std::string &type="", const std::string &expectedType="")
Construct a new Invalid Configuration Music Type object.
Definition Invalid.cpp:440
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:449
This is the class in charge of informing the user that the key type present in the file is of the wro...
Definition Invalid.hpp:639
~InvalidConfigurationSpritesheetType()
Destroy the Invalid Configuration Spritesheet Type object.
Definition Invalid.cpp:433
InvalidConfigurationSpritesheetType(const std::string &path="", const std::string &key="", const std::string &type="", const std::string &expectedType="")
Construct a new Invalid Configuration Spritesheet Type object.
Definition Invalid.cpp:426
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:435
This is the class in charge of informing the user that the duration they provided is invalid.
Definition Invalid.hpp:577
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:406
~InvalidDuration()
Destroy the Invalid Duration object.
Definition Invalid.cpp:404
InvalidDuration(const std::string &duration="", const std::string &min="", const std::string &max="")
Construct a new Invalid Duration object.
Definition Invalid.cpp:386
This is the class in charge of informing the user that the font configuration they provided is incorr...
Definition Invalid.hpp:88
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:66
InvalidFontConfiguration(const std::string &userConfiguration="", const std::string &fontName="")
Construct a new Invalid Font Configuration object.
Definition Invalid.cpp:49
~InvalidFontConfiguration()
Destroy the Invalid Font Configuration object.
Definition Invalid.cpp:64
This is the class in charge of informing the user that the height they entered is invalid.
Definition Invalid.hpp:458
~InvalidFontPath()
Destroy the Invalid Font Path object.
Definition Invalid.cpp:319
InvalidFontPath(const std::string &path="")
Construct a new Invalid Font Path object.
Definition Invalid.cpp:310
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:321
This is the class in charge of informing the user that the window frame limit is invalid.
Definition Invalid.hpp:357
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:254
~InvalidFrameLimit()
Destroy the Invalid Frame Limit object.
Definition Invalid.cpp:252
InvalidFrameLimit(unsigned int frameLimit)
Construct a new Invalid Frame Limit object.
Definition Invalid.cpp:236
This is the class in charge of raising the invalid height error informing the user that the height th...
Definition Invalid.hpp:427
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:304
~InvalidHeight()
Destroy the Invalid Height object.
Definition Invalid.cpp:302
InvalidHeight(const std::string &height="", const std::string &min="", const std::string &max="")
Construct a new Invalid Height object.
Definition Invalid.cpp:284
This is the class in charge of informing the user that the icon configuration they provided is incorr...
Definition Invalid.hpp:179
~InvalidIconConfiguration()
Destroy the Invalid Sprite Configuration object.
Definition Invalid.cpp:140
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:142
InvalidIconConfiguration(const std::string &tomlPath="", const std::string &userConfiguration="", const std::string &iconName="", const std::string &exceptionDetail="")
Construct a new Invalid Sprite Configuration object.
Definition Invalid.cpp:121
This is the class in charge of informing the user that the index they provided is invalid.
Definition Invalid.hpp:546
InvalidIndex(const std::string &index="", const std::string &min="", const std::string &max="")
Construct a new Invalid Index object.
Definition Invalid.cpp:361
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:381
~InvalidIndex()
Destroy the Invalid Index object.
Definition Invalid.cpp:379
This is the class in charge of informing the user that the entered ip is incorrect.
Definition Invalid.hpp:30
~InvalidIp()
Destroy the Invalid Ip object.
Definition Invalid.cpp:27
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:29
InvalidIp(const std::string &error="")
Construct a new Invalid Ip object.
Definition Invalid.cpp:19
This is the class in charge of informing the user that the music configuration they provided is incor...
Definition Invalid.hpp:118
InvalidMusicConfiguration(const std::string &userConfiguration="", const std::string &musicName="")
Construct a new Invalid Music Configuration object.
Definition Invalid.cpp:71
~InvalidMusicConfiguration()
Destroy the Invalid Music Configuration object.
Definition Invalid.cpp:85
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:87
This is the class in charge of informing the user that the port is incorrect.
Definition Invalid.hpp:59
~InvalidPort()
Destroy the Invalid Port object.
Definition Invalid.cpp:42
InvalidPort(const std::string &error="")
Construct a new Invalid Port object.
Definition Invalid.cpp:34
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:44
This is the class in charge of informing the user that they tried to display a non-existent or invali...
Definition Invalid.hpp:487
~InvalidShape()
Destroy the Invalid Shape object.
Definition Invalid.cpp:337
InvalidShape(const std::string &extraDetails="")
Construct a new Invalid Shape object.
Definition Invalid.cpp:327
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:339
This is the class in charge of informing the user that the sprite configuration they provided is inco...
Definition Invalid.hpp:148
~InvalidSpriteConfiguration()
Destroy the Invalid Sprite Configuration object.
Definition Invalid.cpp:114
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:116
InvalidSpriteConfiguration(const std::string &userConfiguration="", const std::string &spriteName="", const std::string &exceptionDetail="")
Construct a new Invalid Sprite Configuration object.
Definition Invalid.cpp:92
This is the class in charge of informing the user that the type of the toml key is not the one that w...
Definition Invalid.hpp:737
InvalidTOMLKeyType(const std::string &tomlPath="", const std::string &tomlKey="", const std::string &currentType="", const std::string &expectedType="")
Construct a new Invalid toml Key Type object.
Definition Invalid.cpp:468
~InvalidTOMLKeyType()
Destroy the Invalid toml Key Type object.
Definition Invalid.cpp:482
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:484
This is the class in charge of informing the user that the toml file they provided is invalid.
Definition Invalid.hpp:608
InvalidTOML(const std::string &path="", const std::string &error="")
Construct a new Invalid toml object.
Definition Invalid.cpp:411
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:421
~InvalidTOML()
Destroy the Invalid toml object.
Definition Invalid.cpp:419
This is the class in charge of informing the user that they tried to display a non-existent or invali...
Definition Invalid.hpp:517
InvalidType(const std::string &extraDetails="")
Construct a new Invalid Type object.
Definition Invalid.cpp:344
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:356
~InvalidType()
Destroy the Invalid Type object.
Definition Invalid.cpp:354
This is the class in charge of raising the invalid width error informing the user that the width they...
Definition Invalid.hpp:394
InvalidWidth(const std::string &width="", const std::string &min="", const std::string &max="")
Construct a new Invalid Width object.
Definition Invalid.cpp:259
~InvalidWidth()
Destroy the Invalid Width object.
Definition Invalid.cpp:277
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:279
This is the class in charge of informing the user that the window height is invalid.
Definition Invalid.hpp:328
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:231
InvalidWindowHeight(const std::string &argument="")
Construct a new Invalid Window Height object.
Definition Invalid.cpp:220
~InvalidWindowHeight()
Destroy the Invalid Window Height object.
Definition Invalid.cpp:229
This is the class in charge of informing the user that the window width is invalid.
Definition Invalid.hpp:241
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:183
InvalidWindowWidth(const std::string &argument="")
Construct a new Invalid Window Width object.
Definition Invalid.cpp:172
~InvalidWindowWidth()
Destroy the Invalid Window Width object.
Definition Invalid.cpp:181
This is the class in charge of informing the user that the window x position is invalid.
Definition Invalid.hpp:270
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:199
InvalidWindowX(const std::string &argument="")
Construct a new Invalid Window X position object.
Definition Invalid.cpp:188
~InvalidWindowX()
Destroy the Invalid Window X position object.
Definition Invalid.cpp:197
This is the class in charge of informing the user that the window Y position is invalid.
Definition Invalid.hpp:299
const char * what() const noexcept
Retrieves the error message.
Definition Invalid.cpp:215
~InvalidWindowY()
Destroy the Invalid Window Width object.
Definition Invalid.cpp:213
InvalidWindowY(const std::string &argument="")
Construct a new Invalid Window Width object.
Definition Invalid.cpp:204