diff --git a/deps/ox/src/ox/std/string.hpp b/deps/ox/src/ox/std/string.hpp index 2fbf8448..a036ed5c 100644 --- a/deps/ox/src/ox/std/string.hpp +++ b/deps/ox/src/ox/std/string.hpp @@ -41,22 +41,22 @@ class BString { char *data() noexcept; - const char *c_str() noexcept; + const char *c_str() const noexcept; /** * Returns the number of characters in this string. */ - std::size_t len() noexcept; + std::size_t len() const noexcept; /** * Returns the number of bytes used for this string. */ - std::size_t size() noexcept; + std::size_t size() const noexcept; /** * Returns the capacity of bytes for this string. */ - std::size_t cap() noexcept; + std::size_t cap() const noexcept; }; template @@ -138,13 +138,13 @@ char *BString::data() noexcept { } template -const char *BString::c_str() noexcept { +const char *BString::c_str() const noexcept { return (const char*) m_buff; } template -std::size_t BString::len() noexcept { +std::size_t BString::len() const noexcept { std::size_t length = 0; for (std::size_t i = 0; i < buffLen; i++) { uint8_t b = m_buff[i]; @@ -162,14 +162,14 @@ std::size_t BString::len() noexcept { } template -std::size_t BString::size() noexcept { +std::size_t BString::size() const noexcept { std::size_t i; for (i = 0; i < buffLen && m_buff[i]; i++); return i + 1; // add one for null terminator } template -std::size_t BString::cap() noexcept { +std::size_t BString::cap() const noexcept { return buffLen; }