Index: code/trunk/src/util/CMakeLists.txt
===================================================================
--- code/trunk/src/util/CMakeLists.txt	(revision 1051)
+++ code/trunk/src/util/CMakeLists.txt	(revision 1052)
@@ -8,4 +8,5 @@
   Math.cc
   String.cc
+  Clipboard.cc
   SubString.cc
   MultiTypePrimitive.cc
Index: code/trunk/src/util/Clipboard.cc
===================================================================
--- code/trunk/src/util/Clipboard.cc	(revision 1052)
+++ code/trunk/src/util/Clipboard.cc	(revision 1052)
@@ -0,0 +1,90 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ *   Windows version inspired by "Copy Text To Clipboard" by Laszlo Szathmary, 2007
+ *      http://www.loria.fr/~szathmar/off/projects/C/CopyTextToClipboard/index.php
+ */
+
+#include "Clipboard.h"
+
+#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
+    #include <windows.h>
+
+    bool toClipboard(std::string text)
+    {
+        try
+        {
+            if (OpenClipboard(0))
+            {
+                EmptyClipboard();
+                HGLOBAL clipbuffer = GlobalAlloc(GMEM_DDESHARE, text.size() + 1);
+                char* buffer = (char*)GlobalLock(clipbuffer);
+                strcpy(buffer, text.c_str());
+                GlobalUnlock(clipbuffer);
+                SetClipboardData(CF_TEXT, clipbuffer);
+                CloseClipboard();
+
+                return true;
+            }
+        }
+        catch (...)
+        {
+        }
+        return false;
+    }
+
+    std::string fromClipboard()
+    {
+        try
+        {
+            if (OpenClipboard(0))
+            {
+                HANDLE hData = GetClipboardData(CF_TEXT);
+                std::string output = (char*)GlobalLock(hData);
+                GlobalUnlock(hData);
+                CloseClipboard();
+
+                return output;
+            }
+        }
+        catch (...)
+        {
+        }
+        return "";
+    }
+#else
+    std::string clipboard = "";
+
+    bool toClipboard(std::string text)
+    {
+        clipboard = text;
+        return true;
+    }
+
+    std::string fromClipboard()
+    {
+        return clipboard;
+    }
+#endif
Index: code/trunk/src/util/Clipboard.h
===================================================================
--- code/trunk/src/util/Clipboard.h	(revision 1052)
+++ code/trunk/src/util/Clipboard.h	(revision 1052)
@@ -0,0 +1,41 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Clipboard_H__
+#define _Clipboard_H__
+
+#include <string>
+
+#include "UtilPrereqs.h"
+
+
+_UtilExport bool toClipboard(std::string text);
+_UtilExport std::string fromClipboard();
+
+
+#endif /* _Clipboard_H__ */
+
Index: code/trunk/src/util/Convert.h
===================================================================
--- code/trunk/src/util/Convert.h	(revision 1051)
+++ code/trunk/src/util/Convert.h	(revision 1052)
@@ -21,6 +21,7 @@
  *   Author:
  *      Benjamin Grauer
+ *      Fabian 'x3n' Landau
  *   Co-authors:
- *      Fabian 'x3n' Landau
+ *      ...
  */
 
@@ -42,101 +43,267 @@
 
 
-// DEFAULT CLASS
-template <typename FromType, typename ToType>
-class Converter
-{
-  public:
-    bool operator()(ToType* output, const FromType& input) const
-    {
-      return false;
-    }
-};
-
-// PARTIAL SPECIALIZATION TO CONVERT TO STRINGS
-template<typename FromType>
-class Converter<FromType, std::string>
-{
-  public:
-    bool operator()(std::string* output, const FromType& input) const
-    {
-      std::ostringstream oss;
-      if (oss << input)
-      {
-        (*output) = oss.str();
+//////////
+// MAIN //
+//////////
+
+// Enum to declare the wanted conversion preference in case of equal type-levels
+enum ConversionPreference
+{
+    CP_PreferToType,
+    CP_PreferFromType,
+};
+
+// Helper classes to determine the preferred partial template specialization
+class _ToType_   {};
+class _FromType_ {};
+class _Explicit_ {};
+
+
+// The default convert functions
+template <class FromType, class ToType, class Type>
+struct ConverterSpecialized
+{
+    enum { specialized = false };
+    static bool convert(ToType* output, const FromType& input)
+    { return false; }
+};
+
+
+// The default convert function if both types are the same
+template <class BothTypes>
+struct ConverterSpecialized<BothTypes, BothTypes, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(BothTypes* output, const BothTypes& input)
+    { (*output) = input; return true; }
+};
+
+
+// The possible levels
+#define __low__  0 // Everything that is or behaves like a primitive type (an can be converted with a typecast to every other low-level type)
+#define __mid__  1 // Everything that has overloaded << and >> operators to operate on a std::stream
+#define __high__ 2 // Everything that doesn't fullfill the lowerlevel-requirements and therefore needs specialized conversions
+
+// Defines the levels of all types: Default is __high__ so you don't have to define every high-level type
+template <class T> struct ConverterLevel           { enum { level = __high__ }; };
+template <> struct ConverterLevel<std::string>     { enum { level = __mid__ }; };
+template <> struct ConverterLevel<orxonox::Radian> { enum { level = __mid__ }; };
+template <> struct ConverterLevel<orxonox::Degree> { enum { level = __mid__ }; };
+template <> struct ConverterLevel<int>             { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned int>    { enum { level = __low__ }; };
+template <> struct ConverterLevel<char>            { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned char>   { enum { level = __low__ }; };
+template <> struct ConverterLevel<short>           { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned short>  { enum { level = __low__ }; };
+template <> struct ConverterLevel<long>            { enum { level = __low__ }; };
+template <> struct ConverterLevel<unsigned long>   { enum { level = __low__ }; };
+template <> struct ConverterLevel<float>           { enum { level = __low__ }; };
+template <> struct ConverterLevel<double>          { enum { level = __low__ }; };
+template <> struct ConverterLevel<long double>     { enum { level = __low__ }; };
+template <> struct ConverterLevel<bool>            { enum { level = __low__ }; };
+
+
+// Calculates the preference based on the levels of FromType and ToType
+template <int from, int to>
+struct ConverterPreference
+{
+    enum
+    {
+        // The maximum of both levels: element of {0, 1, 2}
+        // max 0: Both types are primitives or have a similar behaviour
+        // max 1: At least one type is not a primitive, but both can be put on a std::stream
+        // max 2: There is at least one generic type that needs specialized conversions
+        max = (from > to) ? from : to,
+
+        // The difference between both levels limited to +-1: element of {-1, 0, 1}
+        // diff -1: The FromType has higher level than the ToType
+        // diff  0: Both types have the same level
+        // diff  1: The ToType has higher level than the FromType
+        diff = ((to - from) > 1) ? 1 : (((to - from) < -1) ? -1 : to - from)
+    };
+};
+
+
+// The default conversion: This usually does nothing
+template <int max, class FromType, class ToType>
+struct ConverterDefault
+{
+    static bool convert(ToType* output, const FromType& input)
+    {
+        return false;
+    }
+};
+// The default conversion for primitives: A typecast (defined over two partial specialized templates to exclude all non-primitive types and classes)    template <int max, class FromType, class ToType>
+template <class FromType, class ToType>
+struct ConverterDefault<0, FromType, ToType>
+{
+    static bool convert(ToType* output, const FromType& input)
+    {
+        (*output) = (ToType)input;
         return true;
-      }
-      else
-        return false;
-    }
-};
-
-// PARTIAL SPECIALIZATION TO CONVERT FROM STRING
-template<typename ToType>
-class Converter<std::string, ToType>
-{
-  public:
-    bool operator()(ToType* output, const std::string& input) const
-    {
-      std::istringstream iss(input);
-      if (iss >> (*output))
+    }
+};
+
+
+// Converter: Converts input of FromType into output of ToType
+template <int diff, int max, class FromType, class ToType, ConversionPreference pref>
+struct Converter
+{
+    static bool convert(ToType* output, const FromType& input)
+    {
+        return false;
+    }
+};
+// Converter: level{FromType} > level{ToType}
+template <int max, class FromType, class ToType, ConversionPreference pref>
+struct Converter<-1, max, FromType, ToType, pref>
+{   static bool convert(ToType* output, const FromType& input)
+    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _FromType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _FromType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };
+// Converter: level{FromType} < level{ToType}
+template <int max, class FromType, class ToType, ConversionPreference pref>
+struct Converter<1, max, FromType, ToType, pref>
+{   static bool convert(ToType* output, const FromType& input)
+    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _ToType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _ToType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };
+// Converter: level{FromType} = level{ToType}
+// CP_PreferToType
+template <int max, class FromType, class ToType>
+struct Converter<0, max, FromType, ToType, CP_PreferToType>
+{   static bool convert(ToType* output, const FromType& input)
+    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _ToType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _ToType_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _FromType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _FromType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };
+// CP_PreferFromType
+template <int max, class FromType, class ToType>
+struct Converter<0, max, FromType, ToType, CP_PreferFromType>
+{   static bool convert(ToType* output, const FromType& input)
+    { return (ConverterSpecialized<FromType, ToType, _Explicit_>::specialized) ? (ConverterSpecialized<FromType, ToType, _Explicit_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _FromType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _FromType_>::convert(output, input)) : (ConverterSpecialized<FromType, ToType, _ToType_>::specialized) ? (ConverterSpecialized<FromType, ToType, _ToType_>::convert(output, input)) : (ConverterDefault<max, FromType, ToType>::convert(output, input)); } };
+
+
+// Calls the Converter::convertValue function with the correct template type parameters calculated by ConverterPreference
+template <class FromType, class ToType>
+static bool convertValue(ToType* output, const FromType& input, ConversionPreference preference = CP_PreferToType)
+{
+    return (preference == CP_PreferToType) ?
+           Converter<ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::diff,
+                     ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::max,
+                     FromType,
+                     ToType,
+                     CP_PreferToType>::convert(output, input)
+         : Converter<ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::diff,
+                     ConverterPreference<ConverterLevel<FromType>::level, ConverterLevel<ToType>::level>::max,
+                     FromType,
+                     ToType,
+                     CP_PreferFromType>::convert(output, input);
+}
+
+
+//////////////////////
+// HELPER FUNCTIONS //
+//////////////////////
+
+// Helper function: Calls convertValue with and without default value and returns true if the conversion was successful
+template<class FromType, class ToType>
+static bool ConvertValue(ToType* output, const FromType& input, ConversionPreference preference = CP_PreferToType)
+{
+    return convertValue(output, input, preference);
+}
+template<class FromType, class ToType>
+static bool ConvertValue(ToType* output, const FromType& input, const ToType& fallback, ConversionPreference preference = CP_PreferToType)
+{
+    if (convertValue(output, input, preference))
         return true;
-      else
-        return false;
-    }
-};
-
-// FUNCTION SO WE DO NOT HAVE TO TELL THE COMPILER ABOUT THE TYPE
-template<typename FromType, typename ToType>
-static bool ConvertValue(ToType* output, const FromType& input)
-{
-  Converter<FromType, ToType> converter;
-  return converter(output, input);
+
+    (*output) = fallback;
+    return false;
 }
 
-// THE SAME, BUT WITH DEFAULT VALUE
-template<typename FromType, typename ToType>
-static bool ConvertValue(ToType* output, const FromType& input, const ToType& fallback)
-{
-  Converter<FromType, ToType> converter;
-  if (converter(output, input))
-    return true;
-
-  (*output) = fallback;
-  return false;
+// Helper function: Calls convertValue with and without default value and returns the converted value
+template<class FromType, class ToType>
+static ToType getConvertedValue(const FromType& input, ConversionPreference preference = CP_PreferToType)
+{
+    ToType output = ToType();
+    ConvertValue(&output, input, preference);
+    return output;
 }
-
-// THE SAME LIKE BEFORE, BUT NEEDS NO POINTER TO THE OUTPUT
-template<typename FromType, typename ToType>
-static ToType ConvertValueAndReturn(const FromType& input)
-{
-  ToType output;
-  ConvertValue(&output, input);
-  return output;
+template<class FromType, class ToType>
+static ToType getConvertedValue(const FromType& input, const ToType& fallback, ConversionPreference preference = CP_PreferToType)
+{
+    ToType output = fallback;
+    ConvertValue(&output, input, fallback, preference);
+    return output;
 }
 
-// THE SAME, BUT WITH DEFAULT VALUE
-template<typename FromType, typename ToType>
-static ToType ConvertValueAndReturn(const FromType& input, const FromType& fallback)
-{
-  ToType output;
-  ConvertValue(&output, input, fallback);
-  return output;
-}
-
-//////////////////////////
-// MORE SPECIALISATIONS //
-//////////////////////////
-
-// STRING TO STRING
-template<>
-class Converter<std::string, std::string>
-{
-  public:
-    bool operator()(std::string* output, const std::string& input) const
-    {
-        (*output) = std::string(input);
-        return true;
-    }
-};
+
+/////////////////////
+// SPECIALIZATIONS //
+/////////////////////
+
+/////////////
+// SAMPLES //
+/////////////
+/*
+// convert everything to xyz
+template <class FromType>
+struct ConverterSpecialized<FromType, xyz, _ToType_>
+{
+    enum { specialized = true };
+    static bool convert(xyz* output, const FromType& input)
+    { return ...; }
+};
+
+// convert xyz to everything
+template <class ToType>
+struct ConverterSpecialized<xyz, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const xyz& input)
+    { return ...; }
+};
+
+// convert abc to xyz
+template <>
+struct ConverterSpecialized<abc, xyz, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(xyz* output, const abc& input)
+    { return ...; }
+};
+*/
+
+////////////
+// STRING //
+////////////
+
+// convert to string
+template <class FromType>
+struct ConverterSpecialized<FromType, std::string, _ToType_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const FromType& input)
+    {
+        std::ostringstream oss;
+        if (oss << input)
+        {
+            (*output) = oss.str();
+            return true;
+        }
+        else
+            return false;
+    }
+};
+
+// convert from string
+template <class ToType>
+struct ConverterSpecialized<std::string, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const std::string& input)
+    {
+        std::istringstream iss(input);
+        if (iss >> (*output))
+            return true;
+        else
+            return false;
+    }
+};
+
 
 ////////////////
@@ -144,147 +311,79 @@
 ////////////////
 
-// PARTIAL SPECIALIZATION TO CONVERT FROM MULTITYPEPRIMITIVE
-template<typename ToType>
-class Converter<MultiTypePrimitive, ToType>
-{
-  public:
-    bool operator()(ToType* output, const MultiTypePrimitive& input) const
-    {
-      if (input.getType() == MT_int)
-        return ConvertValue(output, input.getInt());
-      else if (input.getType() == MT_uint)
-        return ConvertValue(output, input.getUnsignedInt());
-      else if (input.getType() == MT_char)
-        return ConvertValue(output, input.getChar());
-      else if (input.getType() == MT_uchar)
-        return ConvertValue(output, input.getUnsignedChar());
-      else if (input.getType() == MT_short)
-        return ConvertValue(output, input.getShort());
-      else if (input.getType() == MT_ushort)
-        return ConvertValue(output, input.getUnsignedShort());
-      else if (input.getType() == MT_long)
-        return ConvertValue(output, input.getLong());
-      else if (input.getType() == MT_ulong)
-        return ConvertValue(output, input.getUnsignedLong());
-      else if (input.getType() == MT_float)
-        return ConvertValue(output, input.getFloat());
-      else if (input.getType() == MT_double)
-        return ConvertValue(output, input.getDouble());
-      else if (input.getType() == MT_longdouble)
-        return ConvertValue(output, input.getLongDouble());
-      else if (input.getType() == MT_bool)
-        return ConvertValue(output, input.getBool());
-      else
-        return false;
-    }
-};
-template<>
-class Converter<MultiTypePrimitive, std::string>
-{
-  public:
-    bool operator()(std::string* output, const MultiTypePrimitive& input) const
-    {
-      if (input.getType() == MT_int)
-        return ConvertValue(output, input.getInt());
-      else if (input.getType() == MT_uint)
-        return ConvertValue(output, input.getUnsignedInt());
-      else if (input.getType() == MT_char)
-        return ConvertValue(output, input.getChar());
-      else if (input.getType() == MT_uchar)
-        return ConvertValue(output, input.getUnsignedChar());
-      else if (input.getType() == MT_short)
-        return ConvertValue(output, input.getShort());
-      else if (input.getType() == MT_ushort)
-        return ConvertValue(output, input.getUnsignedShort());
-      else if (input.getType() == MT_long)
-        return ConvertValue(output, input.getLong());
-      else if (input.getType() == MT_ulong)
-        return ConvertValue(output, input.getUnsignedLong());
-      else if (input.getType() == MT_float)
-        return ConvertValue(output, input.getFloat());
-      else if (input.getType() == MT_double)
-        return ConvertValue(output, input.getDouble());
-      else if (input.getType() == MT_longdouble)
-        return ConvertValue(output, input.getLongDouble());
-      else if (input.getType() == MT_bool)
-        return ConvertValue(output, input.getBool());
-      else
-        return false;
-    }
-};
-
-// PARTIAL SPECIALIZATION TO CONVERT FROM MULTITYPESTRING
-template<typename ToType>
-class Converter<MultiTypeString, ToType>
-{
-  public:
-    bool operator()(ToType* output, const MultiTypeString& input) const
-    {
-      if (input.getType() == MT_constchar)
-        return ConvertValue(output, input.getConstChar());
-      else if (input.getType() == MT_string)
-        return ConvertValue(output, input.getString());
-      else
-        return ConvertValue(output, (MultiTypePrimitive)input);
-    }
-};
-template<>
-class Converter<MultiTypeString, std::string>
-{
-  public:
-    bool operator()(std::string* output, const MultiTypeString& input) const
-    {
-      if (input.getType() == MT_constchar)
-        return ConvertValue(output, input.getConstChar());
-      else if (input.getType() == MT_string)
-        return ConvertValue(output, input.getString());
-      else
-        return ConvertValue(output, (MultiTypePrimitive)input);
-    }
-};
-
-// PARTIAL SPECIALIZATION TO CONVERT FROM MULTITYPEMATH
-template<typename ToType>
-class Converter<MultiTypeMath, ToType>
-{
-  public:
-    bool operator()(ToType* output, const MultiTypeMath& input) const
-    {
-      if (input.getType() == MT_vector2)
-        return ConvertValue(output, input.getVector2());
-      else if (input.getType() == MT_vector3)
-        return ConvertValue(output, input.getVector3());
-      else if (input.getType() == MT_quaternion)
-        return ConvertValue(output, input.getQuaternion());
-      else if (input.getType() == MT_colourvalue)
-        return ConvertValue(output, input.getColourValue());
-      else if (input.getType() == MT_radian)
-        return ConvertValue(output, input.getRadian());
-      else if (input.getType() == MT_degree)
-        return ConvertValue(output, input.getDegree());
-      else
-        return ConvertValue(output, (MultiTypeString)input);
-    }
-};
-template<>
-class Converter<MultiTypeMath, std::string>
-{
-  public:
-    bool operator()(std::string* output, const MultiTypeMath& input) const
-    {
-      if (input.getType() == MT_vector2)
-        return ConvertValue(output, input.getVector2());
-      else if (input.getType() == MT_vector3)
-        return ConvertValue(output, input.getVector3());
-      else if (input.getType() == MT_quaternion)
-        return ConvertValue(output, input.getQuaternion());
-      else if (input.getType() == MT_colourvalue)
-        return ConvertValue(output, input.getColourValue());
-      else if (input.getType() == MT_radian)
-        return ConvertValue(output, input.getRadian());
-      else if (input.getType() == MT_degree)
-        return ConvertValue(output, input.getDegree());
-      else
-        return ConvertValue(output, (MultiTypeString)input);
+// convert from MultiTypePrimitive
+template <class ToType>
+struct ConverterSpecialized<MultiTypePrimitive, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const MultiTypePrimitive& input)
+    {
+        if (input.getType() == MT_void)
+            return ConvertValue(output, input.getVoid());
+        else if (input.getType() == MT_int)
+            return ConvertValue(output, input.getInt());
+        else if (input.getType() == MT_uint)
+            return ConvertValue(output, input.getUnsignedInt());
+        else if (input.getType() == MT_char)
+            return ConvertValue(output, input.getChar());
+        else if (input.getType() == MT_uchar)
+            return ConvertValue(output, input.getUnsignedChar());
+        else if (input.getType() == MT_short)
+            return ConvertValue(output, input.getShort());
+        else if (input.getType() == MT_ushort)
+            return ConvertValue(output, input.getUnsignedShort());
+        else if (input.getType() == MT_long)
+            return ConvertValue(output, input.getLong());
+        else if (input.getType() == MT_ulong)
+            return ConvertValue(output, input.getUnsignedLong());
+        else if (input.getType() == MT_float)
+            return ConvertValue(output, input.getFloat());
+        else if (input.getType() == MT_double)
+            return ConvertValue(output, input.getDouble());
+        else if (input.getType() == MT_longdouble)
+            return ConvertValue(output, input.getLongDouble());
+        else if (input.getType() == MT_bool)
+            return ConvertValue(output, input.getBool());
+        else
+            return false;
+    }
+};
+
+// convert from MultiTypeString
+template <class ToType>
+struct ConverterSpecialized<MultiTypeString, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const MultiTypeString& input)
+    {
+        if (input.getType() == MT_constchar)
+            return ConvertValue(output, input.getConstChar());
+        else if (input.getType() == MT_string)
+            return ConvertValue(output, input.getString());
+        else
+            return ConvertValue(output, (MultiTypePrimitive)input);
+    }
+};
+
+// convert from MultiTypeMath
+template <class ToType>
+struct ConverterSpecialized<MultiTypeMath, ToType, _FromType_>
+{
+    enum { specialized = true };
+    static bool convert(ToType* output, const MultiTypeMath& input)
+    {
+        if (input.getType() == MT_vector2)
+            return ConvertValue(output, input.getVector2());
+        else if (input.getType() == MT_vector3)
+            return ConvertValue(output, input.getVector3());
+        else if (input.getType() == MT_quaternion)
+            return ConvertValue(output, input.getQuaternion());
+        else if (input.getType() == MT_colourvalue)
+            return ConvertValue(output, input.getColourValue());
+        else if (input.getType() == MT_radian)
+            return ConvertValue(output, input.getRadian());
+        else if (input.getType() == MT_degree)
+            return ConvertValue(output, input.getDegree());
+        else
+            return ConvertValue(output, (MultiTypeString)input);
     }
 };
@@ -297,17 +396,16 @@
 // Vector2 to std::string
 template <>
-class Converter<orxonox::Vector2, std::string>
-{
-  public:
-    bool operator()(std::string* output, const orxonox::Vector2& input) const
-    {
-      std::ostringstream ostream;
-      if (ostream << input.x << "," << input.y)
-      {
-        (*output) = ostream.str();
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<orxonox::Vector2, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::Vector2& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.x << "," << input.y)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
 };
@@ -315,17 +413,16 @@
 // Vector3 to std::string
 template <>
-class Converter<orxonox::Vector3, std::string>
-{
-  public:
-    bool operator()(std::string* output, const orxonox::Vector3& input) const
-    {
-      std::ostringstream ostream;
-      if (ostream << input.x << "," << input.y << "," << input.z)
-      {
-        (*output) = ostream.str();
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<orxonox::Vector3, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::Vector3& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.x << "," << input.y << "," << input.z)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
 };
@@ -333,17 +430,16 @@
 // Vector4 to std::string
 template <>
-class Converter<orxonox::Vector4, std::string>
-{
-  public:
-    bool operator()(std::string* output, const orxonox::Vector4& input) const
-    {
-      std::ostringstream ostream;
-      if (ostream << input.x << "," << input.y << "," << input.z << "," << input.w)
-      {
-        (*output) = ostream.str();
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<orxonox::Vector4, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::Vector4& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.x << "," << input.y << "," << input.z << "," << input.w)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
 };
@@ -351,17 +447,16 @@
 // Quaternion to std::string
 template <>
-class Converter<orxonox::Quaternion, std::string>
-{
-  public:
-    bool operator()(std::string* output, const orxonox::Quaternion& input) const
-    {
-      std::ostringstream ostream;
-      if (ostream << input.w << "," << input.x << "," << input.y << "," << input.z)
-      {
-        (*output) = ostream.str();
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<orxonox::Quaternion, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::Quaternion& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.w << "," << input.x << "," << input.y << "," << input.z)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
 };
@@ -369,17 +464,16 @@
 // ColourValue to std::string
 template <>
-class Converter<orxonox::ColourValue, std::string>
-{
-  public:
-    bool operator()(std::string* output, const orxonox::ColourValue& input) const
-    {
-      std::ostringstream ostream;
-      if (ostream << input.r << "," << input.g << "," << input.b << "," << input.a)
-      {
-        (*output) = ostream.str();
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<orxonox::ColourValue, std::string, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(std::string* output, const orxonox::ColourValue& input)
+    {
+        std::ostringstream ostream;
+        if (ostream << input.r << "," << input.g << "," << input.b << "," << input.a)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
 };
@@ -392,25 +486,23 @@
 // std::string to Vector2
 template <>
-class Converter<std::string, orxonox::Vector2>
-{
-  public:
-    bool operator()(orxonox::Vector2* output, const std::string& input) const
-    {
-      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
-
-      if (tokens.size() >= 2)
-      {
-        if (!ConvertValue(&(output->x), tokens[0]))
-          return false;
-        if (!ConvertValue(&(output->y), tokens[1]))
-          return false;
-
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<std::string, orxonox::Vector2, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::Vector2* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 2)
+        {
+            if (!ConvertValue(&(output->x), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[1]))
+                return false;
+
+            return true;
+        }
+        return false;
     }
 };
@@ -418,27 +510,25 @@
 // std::string to Vector3
 template <>
-class Converter<std::string, orxonox::Vector3>
-{
-  public:
-    bool operator()(orxonox::Vector3* output, const std::string& input) const
-    {
-      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
-
-      if (tokens.size() >= 3)
-      {
-        if (!ConvertValue(&(output->x), tokens[0]))
-          return false;
-        if (!ConvertValue(&(output->y), tokens[1]))
-          return false;
-        if (!ConvertValue(&(output->z), tokens[2]))
-          return false;
-
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<std::string, orxonox::Vector3, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::Vector3* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 3)
+        {
+            if (!ConvertValue(&(output->x), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->z), tokens[2]))
+                return false;
+
+            return true;
+        }
+        return false;
     }
 };
@@ -446,29 +536,27 @@
 // std::string to Vector4
 template <>
-class Converter<std::string, orxonox::Vector4>
-{
-  public:
-    bool operator()(orxonox::Vector4* output, const std::string& input) const
-    {
-      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
-
-      if (tokens.size() >= 4)
-      {
-        if (!ConvertValue(&(output->x), tokens[0]))
-          return false;
-        if (!ConvertValue(&(output->y), tokens[1]))
-          return false;
-        if (!ConvertValue(&(output->z), tokens[2]))
-          return false;
-        if (!ConvertValue(&(output->w), tokens[3]))
-          return false;
-
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<std::string, orxonox::Vector4, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::Vector4* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 4)
+        {
+            if (!ConvertValue(&(output->x), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->z), tokens[2]))
+                return false;
+            if (!ConvertValue(&(output->w), tokens[3]))
+                return false;
+
+            return true;
+        }
+        return false;
     }
 };
@@ -476,29 +564,27 @@
 // std::string to Quaternion
 template <>
-class Converter<std::string, orxonox::Quaternion>
-{
-  public:
-    bool operator()(orxonox::Quaternion* output, const std::string& input) const
-    {
-      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
-
-      if (tokens.size() >= 4)
-      {
-        if (!ConvertValue(&(output->w), tokens[0]))
-          return false;
-        if (!ConvertValue(&(output->x), tokens[1]))
-          return false;
-        if (!ConvertValue(&(output->y), tokens[2]))
-          return false;
-        if (!ConvertValue(&(output->z), tokens[3]))
-          return false;
-
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<std::string, orxonox::Quaternion, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::Quaternion* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 4)
+        {
+            if (!ConvertValue(&(output->w), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->x), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->y), tokens[2]))
+                return false;
+            if (!ConvertValue(&(output->z), tokens[3]))
+                return false;
+
+            return true;
+        }
+        return false;
     }
 };
@@ -506,29 +592,27 @@
 // std::string to ColourValue
 template <>
-class Converter<std::string, orxonox::ColourValue>
-{
-  public:
-    bool operator()(orxonox::ColourValue* output, const std::string& input) const
-    {
-      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
-
-      if (tokens.size() >= 4)
-      {
-        if (!ConvertValue(&(output->r), tokens[0]))
-          return false;
-        if (!ConvertValue(&(output->g), tokens[1]))
-          return false;
-        if (!ConvertValue(&(output->b), tokens[2]))
-          return false;
-        if (!ConvertValue(&(output->a), tokens[3]))
-          return false;
-
-        return true;
-      }
-
-      return false;
+struct ConverterSpecialized<std::string, orxonox::ColourValue, _Explicit_>
+{
+    enum { specialized = true };
+    static bool convert(orxonox::ColourValue* output, const std::string& input)
+    {
+        unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+        if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
+
+        SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+        if (tokens.size() >= 4)
+        {
+            if (!ConvertValue(&(output->r), tokens[0]))
+                return false;
+            if (!ConvertValue(&(output->g), tokens[1]))
+                return false;
+            if (!ConvertValue(&(output->b), tokens[2]))
+                return false;
+            if (!ConvertValue(&(output->a), tokens[3]))
+                return false;
+
+            return true;
+        }
+        return false;
     }
 };
Index: code/trunk/src/util/Math.h
===================================================================
--- code/trunk/src/util/Math.h	(revision 1051)
+++ code/trunk/src/util/Math.h	(revision 1052)
@@ -26,6 +26,6 @@
  */
 
-#ifndef _Math_H__
-#define _Math_H__
+#ifndef _Util_Math_H__
+#define _Util_Math_H__
 
 #include <ostream>
@@ -146,4 +146,3 @@
 }
 
-#endif /* _Math_H__ */
-
+#endif /* _Util_Math_H__ */
Index: code/trunk/src/util/MultiType.h
===================================================================
--- code/trunk/src/util/MultiType.h	(revision 1051)
+++ code/trunk/src/util/MultiType.h	(revision 1052)
@@ -35,4 +35,5 @@
 {
     MT_null,
+    MT_void,
     MT_int,
     MT_uint,
@@ -49,4 +50,5 @@
     MT_constchar,
     MT_string,
+    MT_xmlelement,
     MT_vector2,
     MT_vector3,
@@ -59,4 +61,5 @@
 union _UtilExport MultiTypeValue
 {
+    void*           void_;
     int             int_;
     unsigned int    uint_;
Index: code/trunk/src/util/MultiTypeMath.cc
===================================================================
--- code/trunk/src/util/MultiTypeMath.cc	(revision 1051)
+++ code/trunk/src/util/MultiTypeMath.cc	(revision 1052)
@@ -88,44 +88,46 @@
 }
 
+MultiTypeMath::operator void*() const
+{ return (this->type_ == MT_void) ? this->value_.void_ : getConvertedValue<MultiTypeMath, void*>(*this, 0); }
 MultiTypeMath::operator int() const
-{ return (this->type_ == MT_int) ? this->value_.int_ : ConvertValueAndReturn<MultiTypeMath, int>(*this); }
+{ return (this->type_ == MT_int) ? this->value_.int_ : getConvertedValue<MultiTypeMath, int>(*this, 0); }
 MultiTypeMath::operator unsigned int() const
-{ return (this->type_ == MT_uint) ? this->value_.uint_ : ConvertValueAndReturn<MultiTypeMath, unsigned int>(*this); }
+{ return (this->type_ == MT_uint) ? this->value_.uint_ : getConvertedValue<MultiTypeMath, unsigned int>(*this, 0); }
 MultiTypeMath::operator char() const
-{ return (this->type_ == MT_char) ? this->value_.char_ : ConvertValueAndReturn<MultiTypeMath, char>(*this); }
+{ return (this->type_ == MT_char) ? this->value_.char_ : getConvertedValue<MultiTypeMath, char>(*this, 0); }
 MultiTypeMath::operator unsigned char() const
-{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : ConvertValueAndReturn<MultiTypeMath, unsigned char>(*this); }
+{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : getConvertedValue<MultiTypeMath, unsigned char>(*this, 0); }
 MultiTypeMath::operator short() const
-{ return (this->type_ == MT_short) ? this->value_.short_ : ConvertValueAndReturn<MultiTypeMath, short>(*this); }
+{ return (this->type_ == MT_short) ? this->value_.short_ : getConvertedValue<MultiTypeMath, short>(*this, 0); }
 MultiTypeMath::operator unsigned short() const
-{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : ConvertValueAndReturn<MultiTypeMath, unsigned short>(*this); }
+{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : getConvertedValue<MultiTypeMath, unsigned short>(*this, 0); }
 MultiTypeMath::operator long() const
-{ return (this->type_ == MT_long) ? this->value_.long_ : ConvertValueAndReturn<MultiTypeMath, long>(*this); }
+{ return (this->type_ == MT_long) ? this->value_.long_ : getConvertedValue<MultiTypeMath, long>(*this, 0); }
 MultiTypeMath::operator unsigned long() const
-{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : ConvertValueAndReturn<MultiTypeMath, unsigned long>(*this); }
+{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : getConvertedValue<MultiTypeMath, unsigned long>(*this, 0); }
 MultiTypeMath::operator float() const
-{ return (this->type_ == MT_float) ? this->value_.float_ : ConvertValueAndReturn<MultiTypeMath, float>(*this); }
+{ return (this->type_ == MT_float) ? this->value_.float_ : getConvertedValue<MultiTypeMath, float>(*this, 0); }
 MultiTypeMath::operator double() const
-{ return (this->type_ == MT_double) ? this->value_.double_ : ConvertValueAndReturn<MultiTypeMath, double>(*this); }
+{ return (this->type_ == MT_double) ? this->value_.double_ : getConvertedValue<MultiTypeMath, double>(*this, 0); }
 MultiTypeMath::operator long double() const
-{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : ConvertValueAndReturn<MultiTypeMath, long double>(*this); }
+{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : getConvertedValue<MultiTypeMath, long double>(*this, 0); }
 MultiTypeMath::operator bool() const
-{ return (this->type_ == MT_bool) ? this->value_.bool_ : ConvertValueAndReturn<MultiTypeMath, bool>(*this); }
+{ return (this->type_ == MT_bool) ? this->value_.bool_ : getConvertedValue<MultiTypeMath, bool>(*this, 0); }
 MultiTypeMath::operator std::string() const
-{ return (this->type_ == MT_string) ? this->string_ : ConvertValueAndReturn<MultiTypeMath, std::string>(*this); }
+{ return (this->type_ == MT_string) ? this->string_ : getConvertedValue<MultiTypeMath, std::string>(*this); }
 MultiTypeMath::operator const char*() const
-{ return ((this->type_ == MT_constchar) ? this->string_ : ConvertValueAndReturn<MultiTypeMath, std::string>(*this)).c_str(); }
+{ return ((this->type_ == MT_constchar) ? this->string_ : getConvertedValue<MultiTypeMath, std::string>(*this)).c_str(); }
 MultiTypeMath::operator orxonox::Vector2() const
-{ return (this->type_ == MT_vector2) ? this->vector2_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Vector2>(*this); }
+{ return (this->type_ == MT_vector2) ? this->vector2_ : getConvertedValue<MultiTypeMath, orxonox::Vector2>(*this); }
 MultiTypeMath::operator orxonox::Vector3() const
-{ return (this->type_ == MT_vector3) ? this->vector3_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Vector3>(*this); }
+{ return (this->type_ == MT_vector3) ? this->vector3_ : getConvertedValue<MultiTypeMath, orxonox::Vector3>(*this); }
 MultiTypeMath::operator orxonox::Quaternion() const
-{ return (this->type_ == MT_quaternion) ? this->quaternion_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Quaternion>(*this); }
+{ return (this->type_ == MT_quaternion) ? this->quaternion_ : getConvertedValue<MultiTypeMath, orxonox::Quaternion>(*this); }
 MultiTypeMath::operator orxonox::ColourValue() const
-{ return (this->type_ == MT_colourvalue) ? this->colourvalue_ : ConvertValueAndReturn<MultiTypeMath, orxonox::ColourValue>(*this); }
+{ return (this->type_ == MT_colourvalue) ? this->colourvalue_ : getConvertedValue<MultiTypeMath, orxonox::ColourValue>(*this); }
 MultiTypeMath::operator orxonox::Radian() const
-{ return (this->type_ == MT_radian) ? this->radian_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Radian>(*this); }
+{ return (this->type_ == MT_radian) ? this->radian_ : getConvertedValue<MultiTypeMath, orxonox::Radian>(*this); }
 MultiTypeMath::operator orxonox::Degree() const
-{ return (this->type_ == MT_degree) ? this->degree_ : ConvertValueAndReturn<MultiTypeMath, orxonox::Degree>(*this); }
+{ return (this->type_ == MT_degree) ? this->degree_ : getConvertedValue<MultiTypeMath, orxonox::Degree>(*this); }
 
 void MultiTypeMath::setValue(const MultiTypeMath& mtm)
@@ -138,4 +140,22 @@
     this->radian_ = mtm.radian_;
     this->degree_ = mtm.degree_;
+}
+
+std::string MultiTypeMath::getTypename() const
+{
+    if (this->type_ == MT_vector2)
+        return "Vector2";
+    else if (this->type_ == MT_vector3)
+        return "Vector3";
+    else if (this->type_ == MT_colourvalue)
+        return "ColourValue";
+    else if (this->type_ == MT_quaternion)
+        return "Quaternion";
+    else if (this->type_ == MT_radian)
+        return "Radian";
+    else if (this->type_ == MT_degree)
+        return "Degree";
+    else
+        return MultiTypeString::getTypename();
 }
 
Index: code/trunk/src/util/MultiTypeMath.h
===================================================================
--- code/trunk/src/util/MultiTypeMath.h	(revision 1051)
+++ code/trunk/src/util/MultiTypeMath.h	(revision 1052)
@@ -38,5 +38,6 @@
 {
     public:
-        MultiTypeMath(MultiType      type = MT_null);
+        MultiTypeMath(MultiType type = MT_null);
+        inline MultiTypeMath(void*          value) : MultiTypeString(value) {}
         inline MultiTypeMath(int            value) : MultiTypeString(value) {}
         inline MultiTypeMath(unsigned int   value) : MultiTypeString(value) {}
@@ -51,6 +52,6 @@
         inline MultiTypeMath(long double    value) : MultiTypeString(value) {}
         inline MultiTypeMath(bool           value) : MultiTypeString(value) {}
-        inline MultiTypeMath(const char*        value) : MultiTypeString(value) {}
-        inline MultiTypeMath(const std::string& value) : MultiTypeString(value) {}
+        inline MultiTypeMath(const char*             value) : MultiTypeString(value) {}
+        inline MultiTypeMath(const std::string&      value) : MultiTypeString(value) {}
         inline MultiTypeMath(const orxonox::Vector2&     value) { this->setValue(value); }
         inline MultiTypeMath(const orxonox::Vector3&     value) { this->setValue(value); }
@@ -89,4 +90,5 @@
         bool operator!=(const MultiTypeMath& mtm) const;
 
+        virtual operator void*()                const;
         virtual operator int()                  const;
         virtual operator unsigned int()         const;
@@ -141,4 +143,6 @@
         inline void getValue(orxonox::Degree*      variable) const { (*variable) = orxonox::Degree      (this->degree_);      }
 
+        virtual std::string getTypename() const;
+
         virtual std::string toString() const;
         virtual bool fromString(const std::string value);
Index: code/trunk/src/util/MultiTypePrimitive.cc
===================================================================
--- code/trunk/src/util/MultiTypePrimitive.cc	(revision 1051)
+++ code/trunk/src/util/MultiTypePrimitive.cc	(revision 1052)
@@ -34,5 +34,7 @@
     this->type_ = type;
 
-    if (type == MT_int)
+    if (type == MT_void)
+        this->value_.void_ = 0;
+    else if (type == MT_int)
         this->value_.int_ = 0;
     else if (type == MT_uint)
@@ -59,5 +61,5 @@
         this->value_.bool_ = false;
     else
-        this->value_.int_ = 0;
+        this->value_.void_ = 0;
 }
 
@@ -66,5 +68,7 @@
     if (this->type_ == mtp.type_)
     {
-        if (this->type_ == MT_int)
+        if (this->type_ == MT_void)
+            return (this->value_.void_ == mtp.value_.void_);
+        else if (this->type_ == MT_int)
             return (this->value_.int_ == mtp.value_.int_);
         else if (this->type_ == MT_uint)
@@ -99,5 +103,7 @@
     if (this->type_ == mtp.type_)
     {
-        if (this->type_ == MT_int)
+        if (this->type_ == MT_void)
+            return (this->value_.void_ != mtp.value_.void_);
+        else if (this->type_ == MT_int)
             return (this->value_.int_ != mtp.value_.int_);
         else if (this->type_ == MT_uint)
@@ -128,28 +134,30 @@
 }
 
+MultiTypePrimitive::operator void*() const
+{ return (this->type_ == MT_void) ? this->value_.void_ : getConvertedValue<MultiTypePrimitive, void*>(*this, 0); }
 MultiTypePrimitive::operator int() const
-{ return (this->type_ == MT_int) ? this->value_.int_ : ConvertValueAndReturn<MultiTypePrimitive, int>(*this); }
+{ return (this->type_ == MT_int) ? this->value_.int_ : getConvertedValue<MultiTypePrimitive, int>(*this, 0); }
 MultiTypePrimitive::operator unsigned int() const
-{ return (this->type_ == MT_uint) ? this->value_.uint_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned int>(*this); }
+{ return (this->type_ == MT_uint) ? this->value_.uint_ : getConvertedValue<MultiTypePrimitive, unsigned int>(*this, 0); }
 MultiTypePrimitive::operator char() const
-{ return (this->type_ == MT_char) ? this->value_.char_ : ConvertValueAndReturn<MultiTypePrimitive, char>(*this); }
+{ return (this->type_ == MT_char) ? this->value_.char_ : getConvertedValue<MultiTypePrimitive, char>(*this, 0); }
 MultiTypePrimitive::operator unsigned char() const
-{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned char>(*this); }
+{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : getConvertedValue<MultiTypePrimitive, unsigned char>(*this, 0); }
 MultiTypePrimitive::operator short() const
-{ return (this->type_ == MT_short) ? this->value_.short_ : ConvertValueAndReturn<MultiTypePrimitive, short>(*this); }
+{ return (this->type_ == MT_short) ? this->value_.short_ : getConvertedValue<MultiTypePrimitive, short>(*this, 0); }
 MultiTypePrimitive::operator unsigned short() const
-{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned short>(*this); }
+{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : getConvertedValue<MultiTypePrimitive, unsigned short>(*this, 0); }
 MultiTypePrimitive::operator long() const
-{ return (this->type_ == MT_long) ? this->value_.long_ : ConvertValueAndReturn<MultiTypePrimitive, long>(*this); }
+{ return (this->type_ == MT_long) ? this->value_.long_ : getConvertedValue<MultiTypePrimitive, long>(*this, 0); }
 MultiTypePrimitive::operator unsigned long() const
-{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : ConvertValueAndReturn<MultiTypePrimitive, unsigned long>(*this); }
+{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : getConvertedValue<MultiTypePrimitive, unsigned long>(*this, 0); }
 MultiTypePrimitive::operator float() const
-{ return (this->type_ == MT_float) ? this->value_.float_ : ConvertValueAndReturn<MultiTypePrimitive, float>(*this); }
+{ return (this->type_ == MT_float) ? this->value_.float_ : getConvertedValue<MultiTypePrimitive, float>(*this, 0); }
 MultiTypePrimitive::operator double() const
-{ return (this->type_ == MT_double) ? this->value_.double_ : ConvertValueAndReturn<MultiTypePrimitive, double>(*this); }
+{ return (this->type_ == MT_double) ? this->value_.double_ : getConvertedValue<MultiTypePrimitive, double>(*this, 0); }
 MultiTypePrimitive::operator long double() const
-{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : ConvertValueAndReturn<MultiTypePrimitive, long double>(*this); }
+{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : getConvertedValue<MultiTypePrimitive, long double>(*this, 0); }
 MultiTypePrimitive::operator bool() const
-{ return (this->type_ == MT_bool) ? this->value_.bool_ : ConvertValueAndReturn<MultiTypePrimitive, bool>(*this); }
+{ return (this->type_ == MT_bool) ? this->value_.bool_ : getConvertedValue<MultiTypePrimitive, bool>(*this, 0); }
 
 void MultiTypePrimitive::setValue(const MultiTypePrimitive& mtp)
@@ -159,9 +167,43 @@
 }
 
+std::string MultiTypePrimitive::getTypename() const
+{
+    if (this->type_ == MT_void)
+        return "pointer";
+    else if (this->type_ == MT_int)
+        return "int";
+    else if (this->type_ == MT_uint)
+        return "unsigned int";
+    else if (this->type_ == MT_char)
+        return "char";
+    else if (this->type_ == MT_uchar)
+        return "unsigned char";
+    else if (this->type_ == MT_short)
+        return "short";
+    else if (this->type_ == MT_ushort)
+        return "unsigned short";
+    else if (this->type_ == MT_long)
+        return "long";
+    else if (this->type_ == MT_ulong)
+        return "unsigned long";
+    else if (this->type_ == MT_float)
+        return "float";
+    else if (this->type_ == MT_double)
+        return "double";
+    else if (this->type_ == MT_longdouble)
+        return "long double";
+    else if (this->type_ == MT_bool)
+        return "bool";
+    else
+        return "unknown";
+}
+
 std::string MultiTypePrimitive::toString() const
 {
     std::string output;
 
-    if (this->type_ == MT_int)
+    if (this->type_ == MT_void)
+        ConvertValue(&output, this->value_.void_);
+    else if (this->type_ == MT_int)
         ConvertValue(&output, this->value_.int_);
     else if (this->type_ == MT_uint)
@@ -193,5 +235,7 @@
 bool MultiTypePrimitive::fromString(const std::string value)
 {
-    if (this->type_ == MT_int)
+    if (this->type_ == MT_void)
+        return ConvertValue(&this->value_.void_, value, (void*)0);
+    else if (this->type_ == MT_int)
         return ConvertValue(&this->value_.int_, value, (int)0);
     else if (this->type_ == MT_uint)
Index: code/trunk/src/util/MultiTypePrimitive.h
===================================================================
--- code/trunk/src/util/MultiTypePrimitive.h	(revision 1051)
+++ code/trunk/src/util/MultiTypePrimitive.h	(revision 1052)
@@ -36,8 +36,13 @@
 #include "MultiType.h"
 
+namespace orxonox
+{
+    class BaseObject;
+}
 class _UtilExport MultiTypePrimitive
 {
     public:
-        MultiTypePrimitive(MultiType      type = MT_null);
+        MultiTypePrimitive(MultiType type = MT_null);
+        inline MultiTypePrimitive(void*          value) { this->setValue(value); }
         inline MultiTypePrimitive(int            value) { this->setValue(value); }
         inline MultiTypePrimitive(unsigned int   value) { this->setValue(value); }
@@ -56,4 +61,5 @@
 
         inline MultiTypePrimitive& operator=(MultiType      value) { this->type_ = MT_null; return *this; }
+        inline MultiTypePrimitive& operator=(void*          value) { this->setValue(value); return *this; }
         inline MultiTypePrimitive& operator=(int            value) { this->setValue(value); return *this; }
         inline MultiTypePrimitive& operator=(unsigned int   value) { this->setValue(value); return *this; }
@@ -70,4 +76,5 @@
         inline MultiTypePrimitive& operator=(const MultiTypePrimitive& mtp) { this->setValue(mtp); return *this; }
 
+        inline bool operator==(void*          value) const { return (this->value_.void_       == value); }
         inline bool operator==(int            value) const { return (this->value_.int_        == value); }
         inline bool operator==(unsigned int   value) const { return (this->value_.uint_       == value); }
@@ -84,5 +91,5 @@
         bool operator==(const MultiTypePrimitive& mtp) const;
 
-        inline bool operator!=(int            value) const { return (this->value_.int_        != value); }
+        inline bool operator!=(void*          value) const { return (this->value_.void_       != value); }
         inline bool operator!=(unsigned int   value) const { return (this->value_.uint_       != value); }
         inline bool operator!=(char           value) const { return (this->value_.char_       != value); }
@@ -98,4 +105,8 @@
         bool operator!=(const MultiTypePrimitive& mtp) const;
 
+        template <class T>
+        operator T*()                     const
+        { return ((T*)this->value_.void_); }
+        virtual operator void*()          const;
         virtual operator int()            const;
         virtual operator unsigned int()   const;
@@ -111,4 +122,5 @@
         virtual operator bool()           const;
 
+        inline void setValue(void*          value) { this->type_ = MT_void;       this->value_.void_       = value; }
         inline void setValue(int            value) { this->type_ = MT_int;        this->value_.int_        = value; }
         inline void setValue(unsigned int   value) { this->type_ = MT_uint;       this->value_.uint_       = value; }
@@ -125,4 +137,5 @@
         void setValue(const MultiTypePrimitive& mtp);
 
+        inline void*          getVoid()          const { return this->value_.void_;        }
         inline int            getInt()           const { return this->value_.int_;        }
         inline unsigned int   getUnsignedInt()   const { return this->value_.uint_;       }
@@ -151,4 +164,5 @@
         inline bool&           getBool()          { return this->value_.bool_;       }
 
+        inline void getValue(void*           variable) const { variable    = this->value_.void_;       }
         inline void getValue(int*            variable) const { (*variable) = this->value_.int_;        }
         inline void getValue(unsigned int*   variable) const { (*variable) = this->value_.uint_;       }
@@ -167,4 +181,6 @@
         inline bool      isA(MultiType type) const { return (this->type_ == type); }
 
+        virtual std::string getTypename() const;
+
         virtual std::string toString() const;
         virtual bool fromString(const std::string value);
Index: code/trunk/src/util/MultiTypeString.cc
===================================================================
--- code/trunk/src/util/MultiTypeString.cc	(revision 1051)
+++ code/trunk/src/util/MultiTypeString.cc	(revision 1052)
@@ -32,8 +32,5 @@
 MultiTypeString::MultiTypeString(MultiType type) : MultiTypePrimitive(type)
 {
-    if (type == MT_constchar)
-        this->string_ = std::string("");
-    else if (type == MT_string)
-        this->string_ = std::string("");
+    // Nothing to do for string and xml-element
 }
 
@@ -64,32 +61,34 @@
 }
 
+MultiTypeString::operator void*() const
+{ return (this->type_ == MT_void) ? this->value_.void_ : getConvertedValue<MultiTypeString, void*>(*this, 0); }
 MultiTypeString::operator int() const
-{ return (this->type_ == MT_int) ? this->value_.int_ : ConvertValueAndReturn<MultiTypeString, int>(*this); }
+{ return (this->type_ == MT_int) ? this->value_.int_ : getConvertedValue<MultiTypeString, int>(*this, 0); }
 MultiTypeString::operator unsigned int() const
-{ return (this->type_ == MT_uint) ? this->value_.uint_ : ConvertValueAndReturn<MultiTypeString, unsigned int>(*this); }
+{ return (this->type_ == MT_uint) ? this->value_.uint_ : getConvertedValue<MultiTypeString, unsigned int>(*this, 0); }
 MultiTypeString::operator char() const
-{ return (this->type_ == MT_char) ? this->value_.char_ : ConvertValueAndReturn<MultiTypeString, char>(*this); }
+{ return (this->type_ == MT_char) ? this->value_.char_ : getConvertedValue<MultiTypeString, char>(*this, 0); }
 MultiTypeString::operator unsigned char() const
-{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : ConvertValueAndReturn<MultiTypeString, unsigned char>(*this); }
+{ return (this->type_ == MT_uchar) ? this->value_.uchar_ : getConvertedValue<MultiTypeString, unsigned char>(*this, 0); }
 MultiTypeString::operator short() const
-{ return (this->type_ == MT_short) ? this->value_.short_ : ConvertValueAndReturn<MultiTypeString, short>(*this); }
+{ return (this->type_ == MT_short) ? this->value_.short_ : getConvertedValue<MultiTypeString, short>(*this, 0); }
 MultiTypeString::operator unsigned short() const
-{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : ConvertValueAndReturn<MultiTypeString, unsigned short>(*this); }
+{ return (this->type_ == MT_ushort) ? this->value_.ushort_ : getConvertedValue<MultiTypeString, unsigned short>(*this, 0); }
 MultiTypeString::operator long() const
-{ return (this->type_ == MT_long) ? this->value_.long_ : ConvertValueAndReturn<MultiTypeString, long>(*this); }
+{ return (this->type_ == MT_long) ? this->value_.long_ : getConvertedValue<MultiTypeString, long>(*this, 0); }
 MultiTypeString::operator unsigned long() const
-{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : ConvertValueAndReturn<MultiTypeString, unsigned long>(*this); }
+{ return (this->type_ == MT_ulong) ? this->value_.ulong_ : getConvertedValue<MultiTypeString, unsigned long>(*this, 0); }
 MultiTypeString::operator float() const
-{ return (this->type_ == MT_float) ? this->value_.float_ : ConvertValueAndReturn<MultiTypeString, float>(*this); }
+{ return (this->type_ == MT_float) ? this->value_.float_ : getConvertedValue<MultiTypeString, float>(*this, 0); }
 MultiTypeString::operator double() const
-{ return (this->type_ == MT_double) ? this->value_.double_ : ConvertValueAndReturn<MultiTypeString, double>(*this); }
+{ return (this->type_ == MT_double) ? this->value_.double_ : getConvertedValue<MultiTypeString, double>(*this, 0); }
 MultiTypeString::operator long double() const
-{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : ConvertValueAndReturn<MultiTypeString, long double>(*this); }
+{ return (this->type_ == MT_longdouble) ? this->value_.longdouble_ : getConvertedValue<MultiTypeString, long double>(*this, 0); }
 MultiTypeString::operator bool() const
-{ return (this->type_ == MT_bool) ? this->value_.bool_ : ConvertValueAndReturn<MultiTypeString, bool>(*this); }
+{ return (this->type_ == MT_bool) ? this->value_.bool_ : getConvertedValue<MultiTypeString, bool>(*this, 0); }
 MultiTypeString::operator std::string() const
-{ return (this->type_ == MT_string) ? this->string_ : ConvertValueAndReturn<MultiTypeString, std::string>(*this); }
+{ return (this->type_ == MT_string) ? this->string_ : getConvertedValue<MultiTypeString, std::string>(*this); }
 MultiTypeString::operator const char*() const
-{ return ((this->type_ == MT_constchar) ? this->string_ : ConvertValueAndReturn<MultiTypeString, std::string>(*this)).c_str(); }
+{ return ((this->type_ == MT_constchar) ? this->string_ : getConvertedValue<MultiTypeString, std::string>(*this)).c_str(); }
 
 void MultiTypeString::setValue(const MultiTypeString& mts)
@@ -99,6 +98,18 @@
 }
 
+std::string MultiTypeString::getTypename() const
+{
+    if (this->type_ == MT_constchar)
+        return "string";
+    else if (this->type_ == MT_string)
+        return "string";
+    else
+        return MultiTypePrimitive::getTypename();
+}
+
 std::string MultiTypeString::toString() const
 {
+    std::string output;
+
     if (this->type_ == MT_constchar)
         return this->string_;
@@ -107,4 +118,6 @@
     else
         return MultiTypePrimitive::toString();
+
+    return output;
 }
 
Index: code/trunk/src/util/MultiTypeString.h
===================================================================
--- code/trunk/src/util/MultiTypeString.h	(revision 1051)
+++ code/trunk/src/util/MultiTypeString.h	(revision 1052)
@@ -39,5 +39,6 @@
 {
     public:
-        MultiTypeString(MultiType      type = MT_null);
+        MultiTypeString(MultiType type = MT_null);
+        inline MultiTypeString(void*          value) : MultiTypePrimitive(value) {}
         inline MultiTypeString(int            value) : MultiTypePrimitive(value) {}
         inline MultiTypeString(unsigned int   value) : MultiTypePrimitive(value) {}
@@ -52,53 +53,56 @@
         inline MultiTypeString(long double    value) : MultiTypePrimitive(value) {}
         inline MultiTypeString(bool           value) : MultiTypePrimitive(value) {}
-        inline MultiTypeString(const char*        value)   { this->setValue(value); }
-        inline MultiTypeString(const std::string& value)   { this->setValue(value); }
-        inline MultiTypeString(const MultiTypeString& mts) { this->setValue(mts);   }
+        inline MultiTypeString(const char*           value)   { this->setValue(value); }
+        inline MultiTypeString(const std::string&    value)   { this->setValue(value); }
+        inline MultiTypeString(const MultiTypeString& mts)    { this->setValue(mts);   }
         virtual inline ~MultiTypeString() {}
 
         using MultiTypePrimitive::operator=;
-        inline MultiTypeString& operator=(const char*        value)   { this->setValue(value); return *this; }
-        inline MultiTypeString& operator=(const std::string& value)   { this->setValue(value); return *this; }
-        inline MultiTypeString& operator=(const MultiTypeString& mts) { this->setValue(mts);   return *this; }
+        inline MultiTypeString& operator=(const char*             value)   { this->setValue(value); return *this; }
+        inline MultiTypeString& operator=(const std::string&      value)   { this->setValue(value); return *this; }
+        inline MultiTypeString& operator=(const MultiTypeString& mts)      { this->setValue(mts);   return *this; }
 
         using MultiTypePrimitive::operator==;
-        inline bool operator==(const char*        value) const { return (this->string_ == std::string(value)); }
-        inline bool operator==(const std::string& value) const { return (this->string_ == value);              }
+        inline bool operator==(const char*             value) const { return (this->string_      == std::string(value)); }
+        inline bool operator==(const std::string&      value) const { return (this->string_      == value);              }
         bool operator==(const MultiTypeString& mts) const;
 
         using MultiTypePrimitive::operator!=;
-        inline bool operator!=(const char*        value) const { return (this->string_ != std::string(value)); }
-        inline bool operator!=(const std::string& value) const { return (this->string_ != value);              }
+        inline bool operator!=(const char*             value) const { return (this->string_      != std::string(value)); }
+        inline bool operator!=(const std::string&      value) const { return (this->string_      != value);              }
         bool operator!=(const MultiTypeString& mts) const;
 
-        virtual operator int()            const;
-        virtual operator unsigned int()   const;
-        virtual operator char()           const;
-        virtual operator unsigned char()  const;
-        virtual operator short()          const;
-        virtual operator unsigned short() const;
-        virtual operator long()           const;
-        virtual operator unsigned long()  const;
-        virtual operator float ()         const;
-        virtual operator double ()        const;
-        virtual operator long double()    const;
-        virtual operator bool()           const;
-        virtual operator std::string()    const;
-        virtual operator const char*()    const;
+        virtual operator void*()                const;
+        virtual operator int()                  const;
+        virtual operator unsigned int()         const;
+        virtual operator char()                 const;
+        virtual operator unsigned char()        const;
+        virtual operator short()                const;
+        virtual operator unsigned short()       const;
+        virtual operator long()                 const;
+        virtual operator unsigned long()        const;
+        virtual operator float ()               const;
+        virtual operator double ()              const;
+        virtual operator long double()          const;
+        virtual operator bool()                 const;
+        virtual operator std::string()          const;
+        virtual operator const char*()          const;
 
         using MultiTypePrimitive::setValue;
-        inline void setValue(const char*        value) { this->type_ = MT_string; this->string_ = std::string(value); }
-        inline void setValue(const std::string& value) { this->type_ = MT_string; this->string_ = value;              }
+        inline void setValue(const char*             value) { this->type_ = MT_string;     this->string_     = std::string(value); }
+        inline void setValue(const std::string&      value) { this->type_ = MT_string;     this->string_     = value;              }
         void setValue(const MultiTypeString& mts);
 
-        inline const std::string getString() const { return this->string_;         }
-        inline const char*  getConstChar()   const { return this->string_.c_str(); }
+        inline std::string getString()          const { return this->string_;         }
+        inline const char*  getConstChar()      const { return this->string_.c_str(); }
 
-        inline const std::string& getString() { return this->string_;         }
-        inline const char*  getConstChar()    { return this->string_.c_str(); }
+        inline std::string& getString()          { return this->string_;         }
+        inline const char*  getConstChar()       { return this->string_.c_str(); }
 
         using MultiTypePrimitive::getValue;
-        inline void getValue(std::string* variable) const { (*variable) = this->string_;         }
-        inline void getValue(const char** variable) const { (*variable) = this->string_.c_str(); }
+        inline void getValue(std::string*      variable) const { (*variable) = this->string_;         }
+        inline void getValue(const char**      variable) const { (*variable) = this->string_.c_str(); }
+
+        virtual std::string getTypename() const;
 
         virtual std::string toString() const;
@@ -106,5 +110,5 @@
 
     protected:
-        std::string string_;
+        std::string      string_;
 };
 
Index: code/trunk/src/util/String.cc
===================================================================
--- code/trunk/src/util/String.cc	(revision 1051)
+++ code/trunk/src/util/String.cc	(revision 1052)
@@ -26,4 +26,6 @@
  */
 
+#include <cctype>
+#include <iostream>
 #include "String.h"
 
@@ -54,4 +56,134 @@
 
 /**
+    @brief Returns a copy of a string without trailing whitespaces.
+    @param str The string
+    @return The modified copy
+*/
+std::string removeTrailingWhitespaces(const std::string& str)
+{
+    unsigned int pos1 = 0;
+    unsigned int pos2 = str.size() - 1;
+    for (; pos1 < str.size() && (str[pos1] == ' ' || str[pos1] == '\t' || str[pos1] == '\n'); pos1++);
+    for (; pos2 >= 0         && (str[pos2] == ' ' || str[pos2] == '\t' || str[pos2] == '\n'); pos2--);
+    return str.substr(pos1, pos2 - pos1 + 1);
+}
+
+/**
+    @brief Returns the position of the next quote in the string, starting with start.
+    @param str The string
+    @param start The startposition
+    @return The position of the next quote (std::string::npos if there is no next quote)
+*/
+unsigned int getNextQuote(const std::string& str, unsigned int start)
+{
+    unsigned int quote = start - 1;
+
+    while ((quote = str.find('\"', quote + 1)) != std::string::npos)
+    {
+        unsigned int backslash = quote;
+        unsigned int numbackslashes = 0;
+        for (; backslash > 0; backslash--, numbackslashes++)
+            if (str[backslash - 1] != '\\')
+                break;
+
+        if (numbackslashes % 2 == 0)
+            break;
+    }
+
+    return quote;
+}
+
+/**
+    @brief Returns true if pos is between two quotes.
+    @param str The string
+    @param pos The position to check
+    @return True if pos is between two quotes
+*/
+bool isBetweenQuotes(const std::string& str, unsigned int pos)
+{
+    if (pos == std::string::npos)
+        return false;
+
+    unsigned int quotecount = 0;
+    unsigned int quote = 0;
+    while ((quote = getNextQuote(str, quote)) < pos)
+    {
+        quotecount++;
+    }
+
+    if (quote == std::string::npos)
+        return false;
+
+    return ((quotecount % 2) == 1);
+}
+
+/**
+    @brief Returns true if the string contains something like '..."between quotes"...'
+    @param The string
+    @return True if there is something between quotes
+*/
+bool hasStringBetweenQuotes(const std::string& str)
+{
+    unsigned int pos1 = getNextQuote(str, 0);
+    unsigned int pos2 = getNextQuote(str, pos1 + 1);
+    return (pos1 != std::string::npos && pos2 != std::string::npos && pos2 > pos1 + 1);
+}
+
+/**
+    @brief If the string contains something like '..."between quotes"...' then 'between quotes' gets returned (without quotes).
+    @param The string
+    @param The string between the quotes
+*/
+std::string getStringBetweenQuotes(const std::string& str)
+{
+    unsigned int pos1 = getNextQuote(str, 0);
+    unsigned int pos2 = getNextQuote(str, pos1 + 1);
+    if (pos1 != std::string::npos && pos2 != std::string::npos)
+        return str.substr(pos1, pos2 - pos1 + 1);
+    else
+        return "";
+}
+
+/**
+    @brief Removes enclosing quotes if available.
+    @brief str The string to strip
+    @return The string with removed quotes
+*/
+std::string stripEnclosingQuotes(const std::string& str)
+{
+    unsigned int start = std::string::npos;
+    unsigned int end = 0;
+
+    for (unsigned int pos = 0; (pos < str.size()) && (pos < std::string::npos); pos++)
+    {
+        if (str[pos] == '"')
+        {
+            start = pos;
+            break;
+        }
+
+        if ((str[pos] != ' ') && (str[pos] != '\t') && (str[pos] != '\n'))
+            return str;
+    }
+
+    for (unsigned int pos = str.size() - 1; pos < std::string::npos; pos--)
+    {
+        if (str[pos] == '"')
+        {
+            end = pos;
+            break;
+        }
+
+        if ((str[pos] != ' ') && (str[pos] != '\t') && (str[pos] != '\n'))
+            return str;
+    }
+
+    if ((start != std::string::npos) && (end != 0))
+        return str.substr(start + 1, end - start - 1);
+    else
+        return str;
+}
+
+/**
     @brief Determines if a string in is a comment.
     @param str The string to check
@@ -70,6 +202,14 @@
     //  3) ;comment in unreal tournament config-file style
     //  4) //comment in code style
-    if (teststring[0] == '#' || teststring[0] == '%' || teststring[0] == ';' || (teststring[0] == '/' && teststring[0] == '/'))
-        return true;
+    if (teststring.size() >= 2)
+    {
+        if (teststring[0] == '#' || teststring[0] == '%' || teststring[0] == ';' || (teststring[0] == '/' && teststring[1] == '/'))
+            return true;
+    }
+    else if (teststring.size() == 1)
+    {
+        if (teststring[0] == '#' || teststring[0] == '%' || teststring[0] == ';')
+            return true;
+    }
 
     return false;
@@ -83,5 +223,6 @@
 bool isEmpty(const std::string& str)
 {
-    return getStripped(str) == "";
+    std::string temp = getStripped(str);
+    return ((temp == "") || (temp.size() == 0));
 }
 
@@ -109,4 +250,52 @@
 }
 
+std::string addSlashes(const std::string& str)
+{
+    std::string output = str;
+
+    for (unsigned int pos = 0; (pos = output.find('\\', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\\\"); }
+    for (unsigned int pos = 0; (pos = output.find('\n', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\n"); }
+    for (unsigned int pos = 0; (pos = output.find('\t', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\t"); }
+    for (unsigned int pos = 0; (pos = output.find('\v', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\v"); }
+    for (unsigned int pos = 0; (pos = output.find('\b', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\b"); }
+    for (unsigned int pos = 0; (pos = output.find('\r', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\r"); }
+    for (unsigned int pos = 0; (pos = output.find('\f', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\f"); }
+    for (unsigned int pos = 0; (pos = output.find('\a', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\a"); }
+    for (unsigned int pos = 0; (pos = output.find('"', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\\""); }
+    for (unsigned int pos = 0; (pos = output.find('\0', pos)) < std::string::npos; pos += 2) { output.replace(pos, 1, "\\0"); }
+
+    return output;
+}
+
+std::string removeSlashes(const std::string& str)
+{
+    if (str.size() == 0)
+        return str;
+
+    std::string output = "";
+    for (unsigned int pos = 0; pos < str.size() - 1; )
+    {
+        if (str[pos] == '\\')
+        {
+            if (str[pos + 1] == '\\') { output += '\\'; pos += 2; continue; }
+            else if (str[pos + 1] == 'n') { output += '\n'; pos += 2; continue; }
+            else if (str[pos + 1] == 't') { output += '\t'; pos += 2; continue; }
+            else if (str[pos + 1] == 'v') { output += '\v'; pos += 2; continue; }
+            else if (str[pos + 1] == 'b') { output += '\b'; pos += 2; continue; }
+            else if (str[pos + 1] == 'r') { output += '\r'; pos += 2; continue; }
+            else if (str[pos + 1] == 'f') { output += '\f'; pos += 2; continue; }
+            else if (str[pos + 1] == 'a') { output += '\a'; pos += 2; continue; }
+            else if (str[pos + 1] == '"') { output += '"'; pos += 2; continue; }
+            else if (str[pos + 1] == '0') { output += '\0'; pos += 2; continue; }
+        }
+        output += str[pos];
+        pos++;
+        if (pos == str.size() - 1)
+            output += str[pos];
+    }
+
+    return output;
+}
+
 /**
     @brief Replaces each char between A and Z with its lowercase equivalent.
@@ -115,9 +304,8 @@
 void lowercase(std::string* str)
 {
-    static unsigned const char difference_between_A_and_a = 'A' - 'a';
-
-    for (std::string::iterator it = (*str).begin(); it != (*str).end(); ++it)
-        if ((*it) >= 'A' && (*it) <= 'Z')
-            (*it) -= difference_between_A_and_a;
+    for (unsigned int i = 0; i < str->size(); ++i)
+    {
+        (*str)[i] = tolower((*str)[i]);
+    }
 }
 
@@ -140,9 +328,8 @@
 void uppercase(std::string* str)
 {
-    static unsigned const char difference_between_A_and_a = 'A' - 'a';
-
-    for (std::string::iterator it = (*str).begin(); it != (*str).end(); ++it)
-        if ((*it) >= 'a' && (*it) <= 'z')
-            (*it) += difference_between_A_and_a;
+    for (unsigned int i = 0; i < str->size(); ++i)
+    {
+        (*str)[i] = toupper((*str)[i]);
+    }
 }
 
@@ -160,8 +347,8 @@
 
 /**
- * @brief compares two strings without ignoring the case
- * @param s1 first string
- * @param s2 second string
- */
+    @brief compares two strings without ignoring the case
+    @param s1 first string
+    @param s2 second string
+*/
 int nocaseCmp(const std::string& s1, const std::string& s2)
 {
@@ -188,9 +375,9 @@
 
 /**
- * @brief compares two strings without ignoring the case
- * @param s1 first string
- * @param s2 second string
- * @param len how far from the beginning to start.
- */
+    @brief compares two strings without ignoring the case
+    @param s1 first string
+    @param s2 second string
+    @param len how far from the beginning to start.
+*/
 int nocaseCmp(const std::string& s1, const std::string& s2, unsigned int len)
 {
@@ -212,2 +399,47 @@
     return 0;
 }
+
+/**
+    @brief Returns true if the string contains a comment, introduced by #, %, ; or //.
+    @param str The string
+    @return True if the string contains a comment
+*/
+bool hasComment(const std::string& str)
+{
+    return (getCommentPosition(str) != std::string::npos);
+}
+
+/**
+    @brief If the string contains a comment, the comment gets returned (including the comment symbol), an empty string otherwise.
+    @param str The string
+    @return The comment
+*/
+std::string getComment(const std::string& str)
+{
+    return str.substr(getCommentPosition(str));
+}
+
+/**
+    @brief If the string contains a comment, the position of the comment-symbol gets returned, std::string::npos otherwise.
+    @param str The string
+    @return The position
+*/
+unsigned int getCommentPosition(const std::string& str)
+{
+    return getNextCommentPosition(str, 0);
+}
+
+/**
+    @brief Returns the position of the next comment-symbol, starting with start.
+    @param str The string
+    @param start The startposition
+    @return The position
+*/
+unsigned int getNextCommentPosition(const std::string& str, unsigned int start)
+{
+    for (unsigned int i = start; i < str.size(); i++)
+        if (isComment(str.substr(i)))
+            return i;
+
+    return std::string::npos;
+}
Index: code/trunk/src/util/String.h
===================================================================
--- code/trunk/src/util/String.h	(revision 1051)
+++ code/trunk/src/util/String.h	(revision 1052)
@@ -26,6 +26,6 @@
  */
 
-#ifndef _String_H__
-#define _String_H__
+#ifndef _Util_String_H__
+#define _Util_String_H__
 
 #include <string>
@@ -34,19 +34,37 @@
 #include "UtilPrereqs.h"
 
-_UtilExport void        strip(std::string* str);
-_UtilExport std::string getStripped(const std::string& str);
+_UtilExport void         strip(std::string* str);
+_UtilExport std::string  getStripped(const std::string& str);
 
-_UtilExport bool        isEmpty(const std::string& str);
-_UtilExport bool        isComment(const std::string& str);
-_UtilExport bool        isNumeric(const std::string& str);
+_UtilExport std::string  removeTrailingWhitespaces(const std::string& str);
 
-_UtilExport void        lowercase(std::string* str);
-_UtilExport std::string getLowercase(const std::string& str);
+_UtilExport unsigned int getNextQuote(const std::string& str, unsigned int start);
+_UtilExport bool         isBetweenQuotes(const std::string& str, unsigned int pos);
 
-_UtilExport void        uppercase(std::string* str);
-_UtilExport std::string getUppercase(const std::string& str);
+_UtilExport bool         hasStringBetweenQuotes(const std::string& str);
+_UtilExport std::string  getStringBetweenQuotes(const std::string& str);
 
-_UtilExport int         nocaseCmp(const std::string& s1, const std::string& s2);
-_UtilExport int         nocaseCmp(const std::string& s1, const std::string& s2, unsigned int len);
+_UtilExport std::string  stripEnclosingQuotes(const std::string& str);
+
+_UtilExport bool         isEmpty(const std::string& str);
+_UtilExport bool         isComment(const std::string& str);
+_UtilExport bool         isNumeric(const std::string& str);
+
+_UtilExport std::string  addSlashes(const std::string& str);
+_UtilExport std::string  removeSlashes(const std::string& str);
+
+_UtilExport void         lowercase(std::string* str);
+_UtilExport std::string  getLowercase(const std::string& str);
+
+_UtilExport void         uppercase(std::string* str);
+_UtilExport std::string  getUppercase(const std::string& str);
+
+_UtilExport int          nocaseCmp(const std::string& s1, const std::string& s2);
+_UtilExport int          nocaseCmp(const std::string& s1, const std::string& s2, unsigned int len);
+
+_UtilExport bool         hasComment(const std::string& str);
+_UtilExport std::string  getComment(const std::string& str);
+_UtilExport unsigned int getCommentPosition(const std::string& str);
+_UtilExport unsigned int getNextCommentPosition(const std::string& str, unsigned int start = 0);
 
 //! The Convert class has some static member functions to convert strings to values and values to strings.
@@ -144,3 +162,3 @@
 };
 
-#endif /* _String_H__ */
+#endif /* _Util_String_H__ */
Index: code/trunk/src/util/SubString.cc
===================================================================
--- code/trunk/src/util/SubString.cc	(revision 1051)
+++ code/trunk/src/util/SubString.cc	(revision 1052)
@@ -66,7 +66,8 @@
 SubString::SubString(const std::string& string,
                      const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
-                     char escapeChar, char safemode_char, char openparenthesis_char, char closeparenthesis_char, char comment_char)
-{
-  SubString::splitLine(this->strings, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, safemode_char, openparenthesis_char, closeparenthesis_char, comment_char);
+                     char escapeChar, bool removeExcapeChar, char safemode_char, bool removeSafemodeChar,
+                     char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
+{
+  SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeExcapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
 }
 
@@ -79,5 +80,8 @@
 {
   for (unsigned int i = subSetBegin; i < subString.size(); i++)
+  {
     this->strings.push_back(subString[i]);
+    this->bInSafemode.push_back(subString.isInSafemode(i));
+  }
 }
 
@@ -91,6 +95,9 @@
 SubString::SubString(const SubString& subString, unsigned int subSetBegin, unsigned int subSetEnd)
 {
-  for (unsigned int i = subSetBegin; i < subString.size() || i < subSetEnd; i++)
+  for (unsigned int i = subSetBegin; i < subString.size() && i < subSetEnd; i++)
+  {
     this->strings.push_back(subString[i]);
+    this->bInSafemode.push_back(subString.isInSafemode(i));
+  }
 }
 
@@ -103,5 +110,8 @@
 {
   for(unsigned int i = 0; i < argc; ++i)
+  {
     this->strings.push_back(std::string(argv[i]));
+    this->bInSafemode.push_back(false);
+  }
 }
 
@@ -129,4 +139,5 @@
 {
   this->strings = subString.strings;
+  this->bInSafemode = subString.bInSafemode;
   return *this;
 }
@@ -140,5 +151,5 @@
 bool SubString::operator==(const SubString& subString) const
 {
-  return (this->strings == subString.strings);
+  return ((this->strings == subString.strings) && (this->bInSafemode == subString.bInSafemode));
 }
 
@@ -165,5 +176,5 @@
 
   for (unsigned int i = 0; i < length; i++)
-    if (this->strings[i] != subString.strings[i])
+    if ((this->strings[i] != subString.strings[i]) || (this->bInSafemode[i] != subString.bInSafemode[i]))
       return false;
   return true;
@@ -190,5 +201,8 @@
 {
   for (unsigned int i = 0; i < subString.size(); i++)
+  {
     this->strings.push_back(subString[i]);
+    this->bInSafemode.push_back(subString.isInSafemode(i));
+  }
   return *this;
 }
@@ -203,8 +217,9 @@
 {
   this->strings.clear();
+  this->bInSafemode.clear();
   char split[2];
   split[0] = splitter;
   split[1] = '\0';
-  SubString::splitLine(this->strings, string, split);
+  SubString::splitLine(this->strings, this->bInSafemode, string, split);
   return strings.size();
 }
@@ -223,8 +238,10 @@
 unsigned int SubString::split(const std::string& string,
                               const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
-                              char escapeChar, char safemode_char, char openparenthesis_char, char closeparenthesis_char, char comment_char)
+                              char escapeChar, bool removeExcapeChar, char safemode_char, bool removeSafemodeChar,
+                              char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
 {
   this->strings.clear();
-  SubString::splitLine(this->strings, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, safemode_char, openparenthesis_char, closeparenthesis_char, comment_char);
+  this->bInSafemode.clear();
+  SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeExcapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
   return this->strings.size();
 }
@@ -292,7 +309,11 @@
  * @param escape_char: Escape carater (escapes splitters)
  * @param safemode_char: the beginning of the safemode is marked with this
+ * @param removeSafemodeChar removes the safemode_char from the beginning and the ending of a token
+ * @param openparenthesis_char the beginning of a safemode is marked with this
+ * @param closeparenthesis_char the ending of a safemode is marked with this
+ * @param removeParenthesisChars removes the parenthesis from the beginning and the ending of a token
  * @param comment_char: the beginning of a comment is marked with this: (until the end of a Line)
  * @param start_state: the Initial state on how to parse the String.
- * @returns SPLIT_LINE_STATE the parser was in when returning
+ * @return SPLIT_LINE_STATE the parser was in when returning
  *
  * This is the Actual Splitting Algorithm from Clemens Wacha
@@ -302,4 +323,5 @@
 SubString::SPLIT_LINE_STATE
 SubString::splitLine(std::vector<std::string>& ret,
+                     std::vector<bool>& bInSafemode,
                      const std::string& line,
                      const std::string& delimiters,
@@ -307,7 +329,10 @@
                      bool emptyEntries,
                      char escape_char,
+                     bool removeExcapeChar,
                      char safemode_char,
+                     bool removeSafemodeChar,
                      char openparenthesis_char,
                      char closeparenthesis_char,
+                     bool removeParenthesisChars,
                      char comment_char,
                      SPLIT_LINE_STATE start_state)
@@ -318,4 +343,5 @@
 
   std::string token;
+  bool inSafemode = false;
 
   if(start_state != SL_NORMAL && ret.size() > 0)
@@ -323,4 +349,9 @@
     token = ret[ret.size()-1];
     ret.pop_back();
+  }
+  if(start_state != SL_NORMAL && bInSafemode.size() > 0)
+  {
+    inSafemode = bInSafemode[bInSafemode.size()-1];
+    bInSafemode.pop_back();
   }
 
@@ -333,12 +364,20 @@
         {
           state = SL_ESCAPE;
+          if (!removeExcapeChar)
+            token += line[i];
         }
         else if(line[i] == safemode_char)
         {
           state = SL_SAFEMODE;
+          inSafemode = true;
+          if (!removeSafemodeChar)
+            token += line[i];
         }
         else if(line[i] == openparenthesis_char)
         {
           state = SL_PARENTHESES;
+          inSafemode = true;
+          if (!removeParenthesisChars)
+            token += line[i];
         }
         else if(line[i] == comment_char)
@@ -351,4 +390,6 @@
             ret.push_back(token);
             token.clear();
+            bInSafemode.push_back(inSafemode);
+            inSafemode = false;
           }
           token += line[i];       // EAT
@@ -365,4 +406,6 @@
             ret.push_back(token);
             token.clear();
+            bInSafemode.push_back(inSafemode);
+            inSafemode = false;
           }
           state = SL_NORMAL;
@@ -386,13 +429,18 @@
         break;
       case SL_ESCAPE:
-        if(line[i] == 'n') token += '\n';
-        else if(line[i] == 't') token += '\t';
-        else if(line[i] == 'v') token += '\v';
-        else if(line[i] == 'b') token += '\b';
-        else if(line[i] == 'r') token += '\r';
-        else if(line[i] == 'f') token += '\f';
-        else if(line[i] == 'a') token += '\a';
-        else if(line[i] == '?') token += '\?';
-        else token += line[i];  // EAT
+        if (!removeSafemodeChar)
+          token += line[i];
+        else
+        {
+          if(line[i] == 'n') token += '\n';
+          else if(line[i] == 't') token += '\t';
+          else if(line[i] == 'v') token += '\v';
+          else if(line[i] == 'b') token += '\b';
+          else if(line[i] == 'r') token += '\r';
+          else if(line[i] == 'f') token += '\f';
+          else if(line[i] == 'a') token += '\a';
+          else if(line[i] == '?') token += '\?';
+          else token += line[i];  // EAT
+        }
         state = SL_NORMAL;
         break;
@@ -401,4 +449,6 @@
         {
           state = SL_NORMAL;
+          if (!removeSafemodeChar)
+            token += line[i];
         }
         else if(line[i] == escape_char)
@@ -429,4 +479,6 @@
         {
           state = SL_NORMAL;
+          if (!removeParenthesisChars)
+            token += line[i];
         }
         else if(line[i] == escape_char)
@@ -461,4 +513,6 @@
             ret.push_back(token);
             token.clear();
+            bInSafemode.push_back(inSafemode);
+            inSafemode = false;
           }
           state = SL_NORMAL;
@@ -484,4 +538,6 @@
     ret.push_back(token);
     token.clear();
+    bInSafemode.push_back(inSafemode);
+    inSafemode = false;
   }
   return(state);
Index: code/trunk/src/util/SubString.h
===================================================================
--- code/trunk/src/util/SubString.h	(revision 1051)
+++ code/trunk/src/util/SubString.h	(revision 1052)
@@ -88,5 +88,6 @@
   SubString(const std::string& string,
             const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
-            char escapeChar ='\\', char safemode_char = '"', char openparenthesis_char = '(', char closeparenthesis_char = ')', char comment_char = '\0');
+            char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
+            char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
   SubString(unsigned int argc, const char** argv);
   /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
@@ -111,5 +112,6 @@
   unsigned int split(const std::string& string,
                      const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries = false,
-                     char escapeChar ='\\', char safemode_char = '"', char openparenthesis_char = '(', char closeparenthesis_char = ')', char comment_char = '\0');
+                     char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
+                     char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
   std::string join(const std::string& delimiter = " ") const;
   ////////////////////////////////////////
@@ -120,21 +122,24 @@
 
   // retrieve Information from within
-  /** @returns true if the SubString is empty */
+  /** @brief Returns true if the SubString is empty */
   inline bool empty() const { return this->strings.empty(); };
-  /** @returns the count of Strings stored in this substring */
+  /** @brief Returns the count of Strings stored in this substring */
   inline unsigned int size() const { return this->strings.size(); };
-  /** @param i the i'th String @returns the i'th string from the subset of Strings */
+  /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
   inline const std::string& operator[](unsigned int i) const { return this->strings[i]; };
-  /** @param i the i'th String @returns the i'th string from the subset of Strings */
+  /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
   inline const std::string& getString(unsigned int i) const { return (*this)[i]; };
-  /** @returns the front of the StringList. */
+  /** @brief Returns true if the token is in safemode. @param i the i'th token */
+  inline bool isInSafemode(unsigned int i) const { return this->bInSafemode[i]; }
+  /** @brief Returns the front of the StringList. */
   inline const std::string& front() const { return this->strings.front(); };
-  /** @returns the back of the StringList. */
+  /** @brief Returns the back of the StringList. */
   inline const std::string& back() const { return this->strings.back(); };
   /** @brief removes the back of the strings list. */
-  inline void pop_back() { this->strings.pop_back(); };
+  inline void pop_back() { this->strings.pop_back(); this->bInSafemode.pop_back(); };
 
   // the almighty algorithm.
   static SPLIT_LINE_STATE splitLine(std::vector<std::string>& ret,
+                                    std::vector<bool>& bInSafemode,
                                     const std::string& line,
                                     const std::string& delimiters = SubString::WhiteSpaces,
@@ -142,7 +147,10 @@
                                     bool emptyEntries = false,
                                     char escape_char = '\\',
+                                    bool removeExcapeChar = true,
                                     char safemode_char = '"',
+                                    bool removeSafemodeChar = true,
                                     char openparenthesis_char = '(',
                                     char closeparenthesis_char = ')',
+                                    bool removeParenthesisChars = true,
                                     char comment_char = '\0',
                                     SPLIT_LINE_STATE start_state = SL_NORMAL);
@@ -157,4 +165,5 @@
 private:
   std::vector<std::string>  strings;                      //!< strings produced from a single string splitted in multiple strings
+  std::vector<bool>         bInSafemode;
 };
 
Index: code/trunk/src/util/UtilPrereqs.h
===================================================================
--- code/trunk/src/util/UtilPrereqs.h	(revision 1051)
+++ code/trunk/src/util/UtilPrereqs.h	(revision 1052)
@@ -61,6 +61,4 @@
 class ArgReader;
 class Convert;
-template <typename FromType, typename ToType>
-class Converter;
 class MultiTypePrimitive;
 class MultiTypeString;
Index: code/trunk/src/util/tinyxml/ticpp.h
===================================================================
--- code/trunk/src/util/tinyxml/ticpp.h	(revision 1051)
+++ code/trunk/src/util/tinyxml/ticpp.h	(revision 1052)
@@ -973,5 +973,5 @@
  		Stream output operator.
  		*/
- 		friend std::ostream& operator <<( std::ostream& out, Node& base )
+ 		friend std::ostream& operator <<( std::ostream& out, const Node& base )
  		{
  			out << *base.GetTiXmlPointer();
