all repos — openbox @ 58336526043b3e1b4ce583f3392d261438b6eb35

openbox fork - make it a bit more like ryudo

add operator==
Dana Jansens danakj@orodu.net
commit

58336526043b3e1b4ce583f3392d261438b6eb35

parent

b8735c759a0a638a1169089c310baf9de6414597

2 files changed, 21 insertions(+), 0 deletions(-)

jump to
M otk/ustring.ccotk/ustring.cc

@@ -229,6 +229,21 @@ {

return utf8_get_char(utf8_offset_to_ptr(_string.data(), i)); } +bool ustring::operator==(const ustring &other) const +{ + return _string == other._string && _utf8 == other._utf8; +} + +bool ustring::operator==(const std::string &other) const +{ + return _string == other; +} + +bool ustring::operator==(const char *other) const +{ + return _string == other; +} + const char* ustring::data() const { return _string.data();
M otk/ustring.hhotk/ustring.hh

@@ -155,6 +155,12 @@

// No reference return; use replace() to write characters. value_type operator[](size_type i) const; + // compare strings + + bool operator==(const ustring &other) const; + bool operator==(const std::string &other) const; + bool operator==(const char *other) const; + // internal data const char* data() const;