From 305bcb9a42ed52e864ae69de3b2e4937047edc92 Mon Sep 17 00:00:00 2001 From: pescuma Date: Wed, 6 Oct 2010 00:22:35 +0000 Subject: utils: sync with berliOS git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@225 c086bb3d-8645-0410-b8da-73a8550f86e7 --- Plugins/utils/utf8_helpers.h | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'Plugins/utils/utf8_helpers.h') 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; } -- cgit v1.2.3