diff options
author | HampusM <hampus@hampusmat.com> | 2022-05-31 11:39:04 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-05-31 11:39:04 +0200 |
commit | e4b7b5ba2e1371b142167e75a3ddcd63a0e00a48 (patch) | |
tree | df6866e73fdf19962fdd29fd6de5c54ee971db8b /minion/src/util.hpp | |
parent | e75bc5d3fe24979ca59c995a7decbcbf720a20a8 (diff) |
style(minion): change eol to LF
Diffstat (limited to 'minion/src/util.hpp')
-rw-r--r-- | minion/src/util.hpp | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/minion/src/util.hpp b/minion/src/util.hpp index 2955cf1..a36dc5b 100644 --- a/minion/src/util.hpp +++ b/minion/src/util.hpp @@ -1,49 +1,49 @@ -#pragma once - -#include <stddef.h> -#include <stdlib.h> -#include <string.h> - -namespace util -{ - -template <typename Type> -auto malloc(size_t size) noexcept -> Type * -{ - return static_cast<Type *>(::malloc(size)); -} - -/** - * Returns whether or not a string ends with the content of another string. - * - * @param target The string to compare the end of. - * @param target_end The end position of the target string. - * @param other The string to compare with. - */ -auto str_ends_with(const char *target, size_t target_end, const char *other) noexcept - -> bool; - -/** - * Extracts a portion of a string. - * - * @param str The target string. - * @param end A pointer to a place inside the target string. - * @param dest Output buffer. - */ -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 strings contain the same content. - */ -auto streq(const char *str_one, const char *str_two) noexcept -> bool; - -void quit() noexcept; - -} // namespace util +#pragma once
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+namespace util
+{
+
+template <typename Type>
+auto malloc(size_t size) noexcept -> Type *
+{
+ return static_cast<Type *>(::malloc(size));
+}
+
+/**
+ * Returns whether or not a string ends with the content of another string.
+ *
+ * @param target The string to compare the end of.
+ * @param target_end The end position of the target string.
+ * @param other The string to compare with.
+ */
+auto str_ends_with(const char *target, size_t target_end, const char *other) noexcept
+ -> bool;
+
+/**
+ * Extracts a portion of a string.
+ *
+ * @param str The target string.
+ * @param end A pointer to a place inside the target string.
+ * @param dest Output buffer.
+ */
+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 strings contain the same content.
+ */
+auto streq(const char *str_one, const char *str_two) noexcept -> bool;
+
+void quit() noexcept;
+
+} // namespace util
|