summaryrefslogtreecommitdiff
path: root/Plugins/utils/utf8_helpers.h
diff options
context:
space:
mode:
authorpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2010-10-06 00:22:35 +0000
committerpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2010-10-06 00:22:35 +0000
commit305bcb9a42ed52e864ae69de3b2e4937047edc92 (patch)
tree77f29f0d4f7f8c2351280e596f86d6479b522ef2 /Plugins/utils/utf8_helpers.h
parente18d7a839140f01249f470ea40c531b7889c608d (diff)
utils: sync with berliOS
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@225 c086bb3d-8645-0410-b8da-73a8550f86e7
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;
}