Added PCI device detection and a start script.

This commit is contained in:
2024-01-22 01:49:02 +01:00
parent 847bf8c84b
commit fa6dab4f88
13 changed files with 581 additions and 65 deletions

View File

@@ -87,6 +87,38 @@ public:
return append(other);
}
constexpr bool operator==(const basic_string& other) const noexcept
{
if (size() != other.size()) {
return false;
}
for (size_t idx = 0; idx < size(); ++idx) {
if (at(idx) != other.at(idx)) {
return false;
}
}
return true;
}
constexpr bool operator!=(const basic_string& other) const noexcept
{
return !(*this == other); // NOLINT
}
constexpr bool operator==(const value_type* cStr) const noexcept
{
for (value_type chr : *this)
{
if (*cStr == '\0' || chr != *cStr) {
return false;
}
++cStr;
}
return true;
}
constexpr bool operator!=(const value_type* cStr) const noexcept
{
return !(*this == cStr); // NOLINT
}
[[nodiscard]] constexpr reference operator[](size_type pos) noexcept { return _data[pos]; }
[[nodiscard]] constexpr const_reference operator[](size_type pos) const noexcept { return _data[pos]; }
@@ -152,6 +184,18 @@ public:
static inline size_type npos = size_type(-1);
};
using string = basic_string<char>;
template<typename CharT, typename Traits = char_traits<CharT>> // TODO: Allocator
constexpr bool operator==(const CharT* cStr, const basic_string<CharT, Traits>& str) noexcept
{
return str == cStr;
}
template<typename CharT, typename Traits = char_traits<CharT>> // TODO: Allocator
constexpr bool operator!=(const CharT* cStr, const basic_string<CharT, Traits>& str) noexcept
{
return str != cStr;
}
}
#endif // !defined(BAD_APPLE_OS_STRING_INCLUDED)