diff options
author | HampusM <hampus@hampusmat.com> | 2022-05-10 15:47:05 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-05-11 23:14:41 +0200 |
commit | 05cf212e79728c2bf1449ee5cfdf7dd6b1a8c4fd (patch) | |
tree | f613790a2df7b0ac6a5a339f83e43dbd9d547a6a /minion/src/util.hpp | |
parent | 6decaf83fc2b1e751876a76d72c4370b3b66a507 (diff) |
refactor(minion): create request class
Diffstat (limited to 'minion/src/util.hpp')
-rw-r--r-- | minion/src/util.hpp | 16 |
1 files changed, 14 insertions, 2 deletions
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 <typename Type> -Type *malloc(size_t size) noexcept +auto malloc(size_t size) noexcept -> Type * { return static_cast<Type *>(::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 |