From 7139ac4dcc24cb908ed3399384a8f4a580e9ae3c Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Sun, 27 Aug 2023 13:49:32 -0300 Subject: [PATCH] add some methods to windows gd::string --- loader/include/Geode/c++stl/msvcstl.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/loader/include/Geode/c++stl/msvcstl.hpp b/loader/include/Geode/c++stl/msvcstl.hpp index 43a91f0b..763f8f8d 100644 --- a/loader/include/Geode/c++stl/msvcstl.hpp +++ b/loader/include/Geode/c++stl/msvcstl.hpp @@ -118,9 +118,25 @@ namespace gd { return m_data.m_length; } + bool operator<(const gd::string& other) const { + return std::string_view(this->c_str(), this->size()) < std::string_view(other.c_str(), other.size()); + } + + bool empty() const { + return this->size() == 0; + } + + operator bool() const { + return !this->empty(); + } + operator std::string() const { return std::string(this->c_str(), this->size()); } + + operator std::string_view() const { + return std::string_view(this->c_str(), this->size()); + } }; template