Index: code/branches/core2/src/util/Convert.h
===================================================================
--- code/branches/core2/src/util/Convert.h	(revision 968)
+++ code/branches/core2/src/util/Convert.h	(revision 994)
@@ -407,5 +407,5 @@
       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');
+      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
 
       if (tokens.size() >= 2)
@@ -433,5 +433,5 @@
       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');
+      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
 
       if (tokens.size() >= 3)
@@ -461,5 +461,5 @@
       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');
+      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
 
       if (tokens.size() >= 4)
@@ -491,5 +491,5 @@
       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');
+      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
 
       if (tokens.size() >= 4)
@@ -521,5 +521,5 @@
       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');
+      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
 
       if (tokens.size() >= 4)
Index: code/branches/core2/src/util/String.cc
===================================================================
--- code/branches/core2/src/util/String.cc	(revision 968)
+++ code/branches/core2/src/util/String.cc	(revision 994)
@@ -52,4 +52,53 @@
     std::string output = std::string(str);
     strip(&output);
+    return output;
+}
+
+/**
+    @brief Removes enclosing quotes if available.
+    @brief str The string to strip
+*/
+void stripEnclosingQuotes(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;
+    }
+
+    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;
+    }
+
+    if ((start != std::string::npos) && (end != 0))
+        (*str) = (*str).substr(start + 1, end - start - 1);
+}
+
+/**
+    @brief Returns a copy of the string with removed enclosing quotes (if available).
+    @brief str The string to strip
+    @return The striped copy of the string
+*/
+std::string getStrippedEnclosingQuotes(const std::string& str)
+{
+    std::string output = std::string(str);
+    stripEnclosingQuotes(&output);
     return output;
 }
Index: code/branches/core2/src/util/String.h
===================================================================
--- code/branches/core2/src/util/String.h	(revision 968)
+++ code/branches/core2/src/util/String.h	(revision 994)
@@ -36,4 +36,7 @@
 _UtilExport void        strip(std::string* str);
 _UtilExport std::string getStripped(const std::string& str);
+
+_UtilExport void        stripEnclosingQuotes(std::string* str);
+_UtilExport std::string getStrippedEnclosingQuotes(const std::string& str);
 
 _UtilExport bool        isEmpty(const std::string& str);
Index: code/branches/core2/src/util/SubString.cc
===================================================================
--- code/branches/core2/src/util/SubString.cc	(revision 968)
+++ code/branches/core2/src/util/SubString.cc	(revision 994)
@@ -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/branches/core2/src/util/SubString.h
===================================================================
--- code/branches/core2/src/util/SubString.h	(revision 968)
+++ code/branches/core2/src/util/SubString.h	(revision 994)
@@ -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;
 };
 
