From 05cf212e79728c2bf1449ee5cfdf7dd6b1a8c4fd Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 10 May 2022 15:47:05 +0200 Subject: refactor(minion): create request class --- minion/src/util.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'minion/src/util.hpp') diff --git a/minion/src/util.hpp b/minion/src/util.hpp index d6f7f1c..4cc3967 100644 --- a/minion/src/util.hpp +++ b/minion/src/util.hpp @@ -8,12 +8,12 @@ namespace util { template -Type *malloc(size_t size) noexcept +auto malloc(size_t size) noexcept -> Type * { return static_cast(::malloc(size)); } -bool str_ends_with(const char *str, const char *other_str) noexcept; +auto str_ends_with(const char *str, const char *other_str) noexcept -> bool; /** * Extracts a portion of a string. @@ -24,4 +24,16 @@ bool str_ends_with(const char *str, const char *other_str) noexcept; */ void substr(const char *str, const char *end, char *dest) noexcept; +/** + * Compares two strings. + * + * Wrapper function for strcmp. + * + * @param str_one The first string. + * @param str_two The second string. + * + * @returns Whether or not the two string are the same. + */ +auto streq(const char *str_one, const char *str_two) noexcept -> bool; + } // namespace util -- cgit v1.2.3-18-g5258