mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
update openal
This commit is contained in:
parent
62f3b93ff9
commit
6721a6b021
287 changed files with 33851 additions and 27325 deletions
|
|
@ -1,16 +1,41 @@
|
|||
#ifndef AL_STRING_H
|
||||
#define AL_STRING_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
|
||||
namespace al {
|
||||
|
||||
/* These would be better served by using a string_view-like span/view with
|
||||
* case-insensitive char traits.
|
||||
*/
|
||||
template<typename T, typename Traits>
|
||||
[[nodiscard]] constexpr
|
||||
auto sizei(const std::basic_string_view<T,Traits> str) noexcept -> int
|
||||
{ return static_cast<int>(std::min<std::size_t>(str.size(), std::numeric_limits<int>::max())); }
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr bool contains(const std::string_view str0, const std::string_view str1) noexcept
|
||||
{ return str0.find(str1) != std::string_view::npos; }
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr bool starts_with(const std::string_view str0, const std::string_view str1) noexcept
|
||||
{ return str0.substr(0, std::min(str0.size(), str1.size())) == str1; }
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr bool ends_with(const std::string_view str0, const std::string_view str1) noexcept
|
||||
{ return str0.substr(str0.size() - std::min(str0.size(), str1.size())) == str1; }
|
||||
|
||||
[[nodiscard]]
|
||||
int case_compare(const std::string_view str0, const std::string_view str1) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
int case_compare(const std::wstring_view str0, const std::wstring_view str1) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
int strcasecmp(const char *str0, const char *str1) noexcept;
|
||||
[[nodiscard]]
|
||||
int strncasecmp(const char *str0, const char *str1, std::size_t len) noexcept;
|
||||
|
||||
} // namespace al
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue