28 #ifndef BSL_CSTRING_HPP 29 #define BSL_CSTRING_HPP 78 [[maybe_unused]]
inline void *
85 if ((
nullptr == dst) || (count == 0U)) {
89 return BSL_BUILTIN_MEMSET;
114 if ((
nullptr == lhs) || (
nullptr == rhs) || (0U == count)) {
118 return BSL_BUILTIN_MEMCMP;
138 if ((
nullptr == lhs) || (
nullptr == rhs) || (0U == count)) {
142 return BSL_BUILTIN_STRNCMP;
158 if (
nullptr == str) {
162 return BSL_BUILTIN_STRLEN;
175 [[nodiscard]]
inline constexpr cstr_type
182 if ((
nullptr == str) || (0U == count)) {
186 return BSL_BUILTIN_CHAR_MEMCHR;
void * builtin_memset(void *const dst, bsl::int8 const ch, bsl::uintmax const count) noexcept
Same as std::memset with parameter checks. If dst is a nullptr, or count is 0, this function returns ...
Definition: cstring.hpp:79
constexpr void discard(ARGS &&... args) noexcept
This function discards a parameter that it is given. This is the same as executing a static cast....
Definition: discard.hpp:58
constexpr bsl::int32 builtin_strncmp(cstr_type const lhs, cstr_type const rhs, bsl::uintmax const count) noexcept
Same as std::strncmp with parameter checks. If lhs, rhs are a nullptr, or count is 0,...
Definition: cstring.hpp:132
char const * cstr_type
C-style string type.
Definition: cstr_type.hpp:39
::int8_t int8
defines an 8bit signed integer
Definition: cstdint.hpp:36
::int32_t int32
defines an 32bit signed integer
Definition: cstdint.hpp:40
char char_type
Standard Char Type.
Definition: char_type.hpp:41
constexpr cstr_type builtin_strnchr(cstr_type const str, char_type const ch, bsl::uintmax const count) noexcept
Same as std::strnchr with parameter checks. If str is a nullptr, or count is 0, this function returns...
Definition: cstring.hpp:176
constexpr bsl::uintmax builtin_strlen(cstr_type const str) noexcept
Same as std::strlen with parameter checks. If str is a nullptr, this returns 0.
Definition: cstring.hpp:154
::uintmax_t uintmax
defines a unsigned integer with the maximum possible size
Definition: cstdint.hpp:97
bsl::int32 builtin_memcmp(void const *const lhs, void const *const rhs, bsl::uintmax const count) noexcept
Same as std::memcmp with parameter checks. If lhs, rhs are a nullptr, or count is 0,...
Definition: cstring.hpp:108