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.h104
1 files changed, 97 insertions, 7 deletions
diff --git a/Plugins/utils/utf8_helpers.h b/Plugins/utils/utf8_helpers.h
index 1b7785d..c48eb67 100644
--- a/Plugins/utils/utf8_helpers.h
+++ b/Plugins/utils/utf8_helpers.h
@@ -1,3 +1,23 @@
+/*
+Copyright (C) 2009 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
#ifndef __UTF8_HELPERS_H__
# define __UTF8_HELPERS_H__
@@ -39,11 +59,21 @@ public:
mir_free(utf8);
}
- operator char *()
+ char * get() const
+ {
+ return utf8;
+ }
+
+ operator char *() const
{
return utf8;
}
+ char operator[](int pos) const
+ {
+ return utf8[pos];
+ }
+
private:
char *utf8;
@@ -121,11 +151,21 @@ public:
return ret;
}
- operator TCHAR *()
+ TCHAR * get() const
+ {
+ return tchar;
+ }
+
+ operator TCHAR *() const
{
return tchar;
}
+ TCHAR operator[](int pos) const
+ {
+ return tchar[pos];
+ }
+
private:
TCHAR *tchar;
};
@@ -171,11 +211,21 @@ public:
return ret;
}
- operator const TCHAR *()
+ const TCHAR * get() const
+ {
+ return tchar;
+ }
+
+ operator const TCHAR *() const
{
return tchar;
}
+ TCHAR operator[](int pos) const
+ {
+ return tchar[pos];
+ }
+
private:
#ifdef UNICODE
TCHAR *tchar;
@@ -225,11 +275,21 @@ public:
return ret;
}
- operator const TCHAR *()
+ const TCHAR * get() const
{
return tchar;
}
+ operator const TCHAR *() const
+ {
+ return tchar;
+ }
+
+ TCHAR operator[](int pos) const
+ {
+ return tchar[pos];
+ }
+
private:
#ifdef UNICODE
const TCHAR *tchar;
@@ -266,11 +326,21 @@ public:
return ret;
}
- operator const WCHAR *()
+ const WCHAR * get() const
{
return wchar;
}
+ operator const WCHAR *() const
+ {
+ return wchar;
+ }
+
+ WCHAR operator[](int pos) const
+ {
+ return wchar[pos];
+ }
+
private:
WCHAR *wchar;
};
@@ -317,11 +387,21 @@ public:
return ret;
}
- operator const char *()
+ const char * get() const
{
return val;
}
+ operator const char *() const
+ {
+ return val;
+ }
+
+ char operator[](int pos) const
+ {
+ return val[pos];
+ }
+
private:
#ifdef UNICODE
char *val;
@@ -371,11 +451,21 @@ public:
return ret;
}
- operator const WCHAR *()
+ const WCHAR * get() const
{
return val;
}
+ operator const WCHAR *() const
+ {
+ return val;
+ }
+
+ WCHAR operator[](int pos) const
+ {
+ return val[pos];
+ }
+
private:
#ifdef UNICODE
const WCHAR *val;