diff options
author | Sadie Powell <sadie@witchery.services> | 2024-01-10 17:06:59 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-01-10 17:07:17 +0000 |
commit | 99b4305573fae56c6b774ed5c86af224c5f1e9b7 (patch) | |
tree | 94178d5a3325927236517842b161a633a9f39691 /include/anope.h | |
parent | 113301dbbaf22658c502b664ba22cbe4ed1e0e8c (diff) |
Add a wrapper for std::string::compare to Anope::string.
Diffstat (limited to 'include/anope.h')
-rw-r--r-- | include/anope.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/anope.h b/include/anope.h index 31f829195..4d7a197e2 100644 --- a/include/anope.h +++ b/include/anope.h @@ -210,6 +210,10 @@ namespace Anope inline size_type find_last_not_of(const string &_str, size_type pos = npos) const { return this->_string.find_last_not_of(_str._string, pos); } inline size_type find_last_not_of_ci(const string &_str, size_type pos = npos) const { return ci::string(this->_string.c_str()).find_last_not_of(ci::string(_str._string.c_str()), pos); } + inline int compare(size_t pos, size_t len, const string& str) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str())); } + inline int compare(size_t pos, size_t len, const string& str, size_t subpos, size_type sublen = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str()), subpos, sublen); } + inline int compare(size_t pos, size_t len, const char* s, size_type n = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, s, n); } + /** * Determine if string consists of only numbers. */ |