summaryrefslogtreecommitdiffstats
path: root/src/Core/UnicodeString.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-09-27 01:55:44 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-09-27 01:55:44 +0200
commite1d8490f0654a3da0b900407d80d91d8d0da68c8 (patch)
treed65b4bd4a596a98061e094120b6a1aed388d1c89 /src/Core/UnicodeString.cpp
parentd88c486ae403bee8f4b16e4bdf9daf19f8915eed (diff)
downloadmad-e1d8490f0654a3da0b900407d80d91d8d0da68c8.tar
mad-e1d8490f0654a3da0b900407d80d91d8d0da68c8.zip
Use libicu to support unicode properly; migrated ConfigManager to UnicodeString
Diffstat (limited to 'src/Core/UnicodeString.cpp')
-rw-r--r--src/Core/UnicodeString.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/Core/UnicodeString.cpp b/src/Core/UnicodeString.cpp
new file mode 100644
index 0000000..ccace47
--- /dev/null
+++ b/src/Core/UnicodeString.cpp
@@ -0,0 +1,44 @@
+/*
+ * UnicodeString.cpp
+ *
+ * Copyright (C) 2009 Matthias Schiffer <matthias@gamezock.de>
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "UnicodeString.h"
+
+namespace Mad {
+namespace Core {
+
+boost::int32_t UnicodeString::findFirstOf(const UnicodeString &chars, boost::int32_t start) const {
+ for(boost::int32_t i = start; i < length(); ++i) {
+ if(chars.indexOf(charAt(i)) >= 0)
+ return i;
+ }
+
+ return -1;
+}
+
+boost::int32_t UnicodeString::findFirstNotOf(const UnicodeString &chars, boost::int32_t start) const {
+ for(boost::int32_t i = start; i < length(); ++i) {
+ if(chars.indexOf(charAt(i)) < 0)
+ return i;
+ }
+
+ return -1;
+}
+
+}
+}