]> Dogcows Code - chaz/openbox/blobdiff - otk/ustring.cc
80 cols
[chaz/openbox] / otk / ustring.cc
index b6432d4440df46df21136d3826755f5b6b53dd24..7dbe8ece3e1c431d8cceae240fde723bf0ce1523 100644 (file)
@@ -132,13 +132,13 @@ ustring& ustring::operator=(const ustring& other)
   return *this;
 }
 
-ustring::ustring(const std::string& src)
-  : _string(src), _utf8(true)
+ustring::ustring(const std::string& src, bool utf8)
+  : _string(src), _utf8(utf8)
 {
 }
 
-ustring::ustring(const char* src)
-  : _string(src), _utf8(true)
+ustring::ustring(const char* src, bool utf8)
+  : _string(src), _utf8(utf8)
 {
 }
 
@@ -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();
This page took 0.028082 seconds and 4 git commands to generate.