- Began outlining tokenizer.h and priority_queue.h

- Began outlining sdl implementation
- Added some helper definitions to various classes
- Added contains to string.h and wstring.h
This commit is contained in:
2025-09-13 20:33:46 -04:00
parent 3565bbbc52
commit f2a45aa913
16 changed files with 331 additions and 16 deletions

View File

@@ -47,6 +47,7 @@ struct _wstring
{
public:
static constexpr size_t npos = -1;
using char_t = wchar_t;
using alloc_t = allocation<wchar_t, AllocT>;
@@ -216,10 +217,23 @@ public:
return ::wcsncmp(_str + i, str.data(), n);
}
constexpr bool operator==(const wcstring& str) const {
return compare(str) == 0;
}
constexpr bool operator==(const _wstring& str) const {
return compare(str) == 0;
}
///
/// \brief Check if the string contains a character
/// \param c
/// \param i
/// \return
constexpr bool contains(char c, size_t i = 0) const {
return find(c, i) != size();
}
///
/// \brief Finds the index of the first occurrence of `c` in the string
/// \param c the wchar_tacter to find