]> Dogcows Code - chaz/openbox/blobdiff - otk/ustring.cc
pointer's variables are config vars
[chaz/openbox] / otk / ustring.cc
index 8c48cb4d6e64e0fd7eca8dfe315d93fda51273d4..8ffe07fe000ba7c5febf3639b1fd7cf3f7151633 100644 (file)
@@ -1,14 +1,10 @@
 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
 
-#ifdef    HAVE_CONFIG_H
-#  include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
 
 #include "ustring.hh"
 
-extern "C" {
-#include <assert.h>
-}
+#include <cassert>
 
 namespace otk {
 
@@ -111,7 +107,8 @@ ustring::size_type utf8_byte_offset(const char* str, ustring::size_type offset,
 
 // ustring methods
 
-ustring::ustring()
+ustring::ustring(bool utf8)
+  : _utf8(utf8)
 {
 }
 
@@ -131,13 +128,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)
 {
 }
 
@@ -228,6 +225,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.020929 seconds and 4 git commands to generate.