summaryrefslogtreecommitdiff
path: root/Plugins/utils/utf8_helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/utils/utf8_helpers.h')
-rw-r--r--Plugins/utils/utf8_helpers.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/Plugins/utils/utf8_helpers.h b/Plugins/utils/utf8_helpers.h
index c48eb67..3eaf0f4 100644
--- a/Plugins/utils/utf8_helpers.h
+++ b/Plugins/utils/utf8_helpers.h
@@ -59,17 +59,24 @@ public:
mir_free(utf8);
}
- char * get() const
+ char *detach()
+ {
+ char *ret = utf8;
+ utf8 = NULL;
+ return ret;
+ }
+
+ const char * get() const
{
return utf8;
}
- operator char *() const
+ operator const char *() const
{
return utf8;
}
- char operator[](int pos) const
+ const char & operator[](int pos) const
{
return utf8[pos];
}
@@ -161,7 +168,7 @@ public:
return tchar;
}
- TCHAR operator[](int pos) const
+ TCHAR & operator[](int pos)
{
return tchar[pos];
}
@@ -221,7 +228,7 @@ public:
return tchar;
}
- TCHAR operator[](int pos) const
+ const TCHAR & operator[](int pos) const
{
return tchar[pos];
}
@@ -285,7 +292,7 @@ public:
return tchar;
}
- TCHAR operator[](int pos) const
+ const TCHAR & operator[](int pos) const
{
return tchar[pos];
}
@@ -336,7 +343,7 @@ public:
return wchar;
}
- WCHAR operator[](int pos) const
+ const WCHAR & operator[](int pos) const
{
return wchar[pos];
}
@@ -397,7 +404,7 @@ public:
return val;
}
- char operator[](int pos) const
+ const char & operator[](int pos) const
{
return val[pos];
}
@@ -461,7 +468,7 @@ public:
return val;
}
- WCHAR operator[](int pos) const
+ const WCHAR & operator[](int pos) const
{
return val[pos];
}
@@ -543,7 +550,7 @@ public:
#endif
}
- operator const BSTR()
+ operator const BSTR() const
{
return bstr;
}