]> Dogcows Code - chaz/openbox/commitdiff
add operator==
authorDana Jansens <danakj@orodu.net>
Tue, 4 Feb 2003 23:33:07 +0000 (23:33 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 4 Feb 2003 23:33:07 +0000 (23:33 +0000)
otk/ustring.cc
otk/ustring.hh

index 7ac89bf72759ee351754ef88060bd96d51cbecdb..7dbe8ece3e1c431d8cceae240fde723bf0ce1523 100644 (file)
@@ -229,6 +229,21 @@ ustring::value_type ustring::operator[](ustring::size_type i) const
   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();
index 8ee066d3b277dcbfec50a0f16ad7d72da431e3cc..0031e1c5b888db645c7ee397038f3f62d8ade854 100644 (file)
@@ -155,6 +155,12 @@ public:
   // 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;
This page took 0.023612 seconds and 4 git commands to generate.