summaryrefslogtreecommitdiff
path: root/minion/src/util.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-05-10 15:47:05 +0200
committerHampusM <hampus@hampusmat.com>2022-05-11 23:14:41 +0200
commit05cf212e79728c2bf1449ee5cfdf7dd6b1a8c4fd (patch)
treef613790a2df7b0ac6a5a339f83e43dbd9d547a6a /minion/src/util.cpp
parent6decaf83fc2b1e751876a76d72c4370b3b66a507 (diff)
refactor(minion): create request class
Diffstat (limited to 'minion/src/util.cpp')
-rw-r--r--minion/src/util.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/minion/src/util.cpp b/minion/src/util.cpp
index f587781..540a20c 100644
--- a/minion/src/util.cpp
+++ b/minion/src/util.cpp
@@ -3,7 +3,7 @@
namespace util
{
-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
{
if (str == nullptr || other_str == nullptr)
{
@@ -25,11 +25,16 @@ void substr(const char *str, const char *end, char *dest) noexcept
{
auto *dest_head = dest;
- for (const char *char_ptr = str; char_ptr + 1 != end; ++char_ptr)
+ for (const char *char_ptr = str; char_ptr != end; ++char_ptr)
{
*dest_head = *char_ptr;
dest_head++;
}
}
+auto streq(const char *str_one, const char *str_two) noexcept -> bool
+{
+ return strcmp(str_one, str_two) == 0;
+}
+
} // namespace util