mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -05:00
add some methods to windows gd::string
This commit is contained in:
parent
196ab7bb19
commit
7139ac4dcc
1 changed files with 16 additions and 0 deletions
|
@ -118,9 +118,25 @@ namespace gd {
|
||||||
return m_data.m_length;
|
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 {
|
operator std::string() const {
|
||||||
return std::string(this->c_str(), this->size());
|
return std::string(this->c_str(), this->size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
operator std::string_view() const {
|
||||||
|
return std::string_view(this->c_str(), this->size());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|
Loading…
Reference in a new issue