From f34e07b4962f65362afa5ca98759e87929d964bc Mon Sep 17 00:00:00 2001 From: dawidg81 Date: Tue, 27 Jan 2026 19:19:30 +0100 Subject: file node --- src/Utils/catch.cpp | 22 ++++++++++++++++++++++ src/Utils/catchInputInt.cpp | 15 --------------- src/Utils/catchReturn.cpp | 11 ----------- 3 files changed, 22 insertions(+), 26 deletions(-) create mode 100644 src/Utils/catch.cpp delete mode 100644 src/Utils/catchInputInt.cpp delete mode 100644 src/Utils/catchReturn.cpp (limited to 'src') diff --git a/src/Utils/catch.cpp b/src/Utils/catch.cpp new file mode 100644 index 0000000..37ebefe --- /dev/null +++ b/src/Utils/catch.cpp @@ -0,0 +1,22 @@ +#include "Utils.hpp" + +#include +#include + +int Utils::catchInputInt(int* input){ + std::cin >> input; + + if (std::cin.fail()) { + std::cout << "error: Input failed" << std::endl; + return 1; + } + + return 0; +} + +int Utils::catchReturn(int renum){ + if (renum != 0) { + std::cout << "Received error signal, sending further" << std::endl; + } + return 0; +} diff --git a/src/Utils/catchInputInt.cpp b/src/Utils/catchInputInt.cpp deleted file mode 100644 index da99833..0000000 --- a/src/Utils/catchInputInt.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "Utils.hpp" - -#include -#include - -int Utils::catchInputInt(int* input){ - std::cin >> input; - - if (std::cin.fail()) { - std::cout << "error: Input failed" << std::endl; - return 1; - } - - return 0; -} \ No newline at end of file diff --git a/src/Utils/catchReturn.cpp b/src/Utils/catchReturn.cpp deleted file mode 100644 index c3d6722..0000000 --- a/src/Utils/catchReturn.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "Utils.hpp" - -#include -#include - -int Utils::catchReturn(int renum){ - if (renum != 0) { - std::cout << "Received error signal, sending further" << std::endl; - } - return 0; -} \ No newline at end of file -- cgit v1.2.3