From 595914175b3cc3c729e1ab275104ae6f300d6810 Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Thu, 26 Mar 2026 13:17:44 +0100 Subject: [PATCH] feat: line checking utils --- src/utils.cpp | 13 +++++++++++++ src/utils.hpp | 4 ++++ 2 files changed, 17 insertions(+) create mode 100644 src/utils.cpp create mode 100644 src/utils.hpp diff --git a/src/utils.cpp b/src/utils.cpp new file mode 100644 index 0000000..4953966 --- /dev/null +++ b/src/utils.cpp @@ -0,0 +1,13 @@ +#include +#include + +bool isEmptyLine(std::string line) { + for (char c : line) { + if (!isspace(c)) + return false; + } + + return true; +} + +bool isComment(std::string line) { return line[0] == '/' && line[1] == '/'; } diff --git a/src/utils.hpp b/src/utils.hpp new file mode 100644 index 0000000..53cc254 --- /dev/null +++ b/src/utils.hpp @@ -0,0 +1,4 @@ +#include + +bool isEmptyLine(std::string); +bool isComment(std::string);