diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2024-02-22 12:34:47 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-22 12:34:47 -0500 |
| commit | d12d9dad4096af6280c6c418cf36a2faacede102 (patch) | |
| tree | ba52bf26efd8b2f7bf282b0564a68870022cccb7 /src/core/file_sys/fs_string_util.h | |
| parent | 2b3f1d3fc53c1b7a729c3f1cebbddebcd9427952 (diff) | |
| parent | ef5027712413705802d10c797b0f0b66375a9f58 (diff) | |
Merge pull request #12982 from FearlessTobi/fs-rewrite-part0
fs: Add FileSystemAccessor and use cmif serialization
Diffstat (limited to 'src/core/file_sys/fs_string_util.h')
| -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); |
