Doxygen fixes, style fixes
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -24,12 +24,12 @@ namespace ArbUt {
|
||||
EnsureNotNull(value);
|
||||
// For GCC we need to disable a diagnostic that does not like this.
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
#endif
|
||||
strncpy(_value, value, length);
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
_value[length] = 0;
|
||||
@@ -94,7 +94,8 @@ namespace ArbUt {
|
||||
/// @brief Instantiate a StringView using a C string.
|
||||
/// @param str A null-terminated C string.
|
||||
StringView(const char* non_null str)
|
||||
: BasicStringView(CalcLength(str), Hash(str, CalcLength(str))), _str(new __ConstStringCharHolder(str, CalcLength(str))) {}
|
||||
: BasicStringView(CalcLength(str), Hash(str, CalcLength(str))),
|
||||
_str(new __ConstStringCharHolder(str, CalcLength(str))) {}
|
||||
/// @brief Instantiate a StringView using a C string, as well as it's length.
|
||||
/// @param str A null-terminated C string.
|
||||
/// @param length The length of the C string
|
||||
@@ -143,9 +144,13 @@ namespace ArbUt {
|
||||
return _hash != Hash(rhs.data(), rhs.size());
|
||||
}
|
||||
/// @brief Check equality with standard C style string.
|
||||
inline constexpr bool operator==(const char* non_null rhs) const noexcept final { return _hash == Hash(rhs, CalcLength(rhs)); }
|
||||
inline constexpr bool operator==(const char* non_null rhs) const noexcept final {
|
||||
return _hash == Hash(rhs, CalcLength(rhs));
|
||||
}
|
||||
/// @brief Check inequality with standard C style string.
|
||||
inline constexpr bool operator!=(const char* non_null rhs) const noexcept final { return _hash != Hash(rhs, CalcLength(rhs)); }
|
||||
inline constexpr bool operator!=(const char* non_null rhs) const noexcept final {
|
||||
return _hash != Hash(rhs, CalcLength(rhs));
|
||||
}
|
||||
|
||||
/// @brief Calculates the hash for a given C string.
|
||||
/// @param val A null-terminated C string.
|
||||
|
||||
@@ -41,9 +41,13 @@ namespace ArbUt {
|
||||
return _hash != Hash(rhs.data(), rhs.size());
|
||||
}
|
||||
/// @brief Check equality with standard C style string.
|
||||
inline constexpr bool operator==(const char* non_null rhs) const noexcept final { return _hash == Hash(rhs, CalcLength(rhs)); }
|
||||
inline constexpr bool operator==(const char* non_null rhs) const noexcept final {
|
||||
return _hash == Hash(rhs, CalcLength(rhs));
|
||||
}
|
||||
/// @brief Check inequality with standard C style string.
|
||||
inline constexpr bool operator!=(const char* non_null rhs) const noexcept final { return _hash != Hash(rhs, CalcLength(rhs)); }
|
||||
inline constexpr bool operator!=(const char* non_null rhs) const noexcept final {
|
||||
return _hash != Hash(rhs, CalcLength(rhs));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user