From d7c12ca14df7c17fd584573955867bfdc8e54166 Mon Sep 17 00:00:00 2001 From: Drath Date: Sun, 2 Nov 2025 12:37:08 +0100 Subject: [PATCH] ! NEW FUNC ! (macro actually) --- include/utils.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/utils.hpp b/include/utils.hpp index da23b07..d3478f7 100644 --- a/include/utils.hpp +++ b/include/utils.hpp @@ -7,6 +7,8 @@ #define FILL_CHAR ' ' +#define fastReadNum(path, val) readFile2(path, buf, sizeof(buf)); val = strtol(buf, NULL, 10) + // pretty prints num with given decs, 0 by default. its basically a macro so we inline it inline std::string pNum(auto num, uint8_t decs = 0) { return std::format("{:.{}f}", num, decs); } @@ -19,4 +21,4 @@ ssize_t readFile2(const char* path, char* buffer, size_t maxlen); int get_val(std::string_view target, std::string_view content); std::string getFirstDir(std::string_view path); -#endif \ No newline at end of file +#endif