diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/fs_string_util.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/file_sys/fs_string_util.h b/src/core/file_sys/fs_string_util.h index 874e09054..c751a8f1a 100644 --- a/src/core/file_sys/fs_string_util.h +++ b/src/core/file_sys/fs_string_util.h @@ -20,6 +20,11 @@ constexpr int Strlen(const T* str) { } template <typename T> +constexpr int Strnlen(const T* str, std::size_t count) { + return Strnlen(str, static_cast<int>(count)); +} + +template <typename T> constexpr int Strnlen(const T* str, int count) { ASSERT(str != nullptr); ASSERT(count >= 0); @@ -33,6 +38,11 @@ constexpr int Strnlen(const T* str, int count) { } template <typename T> +constexpr int Strncmp(const T* lhs, const T* rhs, std::size_t count) { + return Strncmp(lhs, rhs, static_cast<int>(count)); +} + +template <typename T> constexpr int Strncmp(const T* lhs, const T* rhs, int count) { ASSERT(lhs != nullptr); ASSERT(rhs != nullptr); @@ -52,6 +62,11 @@ constexpr int Strncmp(const T* lhs, const T* rhs, int count) { } template <typename T> +static constexpr int Strlcpy(T* dst, const T* src, std::size_t count) { + return Strlcpy<T>(dst, src, static_cast<int>(count)); +} + +template <typename T> static constexpr int Strlcpy(T* dst, const T* src, int count) { ASSERT(dst != nullptr); ASSERT(src != nullptr); |