Index: branches/std/src/lib/shell/shell_input.cc
===================================================================
--- branches/std/src/lib/shell/shell_input.cc	(revision 7207)
+++ branches/std/src/lib/shell/shell_input.cc	(revision 7216)
@@ -46,6 +46,5 @@
   this->setClassID(CL_SHELL_INPUT, "ShellInput");
 
-  this->inputLine = new char[1];
-  this->inputLine[0] = '\0';
+  this->inputLine = "";
   this->historyIT = this->history.begin();
   this->setHistoryLength(50);
@@ -70,10 +69,8 @@
 {
   // delete what has to be deleted here
-  delete[] this->inputLine;
   delete this->completion;
 
   while (!this->history.empty())
   {
-    delete[] this->history.front();
     this->history.pop_front();
   }
@@ -96,11 +93,6 @@
 void ShellInput::flush()
 {
-  if (likely(this->inputLine != NULL))
-  {
-    delete[] this->inputLine;
-  }
-  this->inputLine = new char[1];
-  *this->inputLine = '\0';
-  this->setText(this->inputLine, true);
+  this->inputLine.clear();
+  this->setText(this->inputLine);
 }
 
@@ -109,18 +101,8 @@
  * @param text the new Text to set as InputLine
  */
-void ShellInput::setInputText(const char* text)
-{
-  delete[] this->inputLine;
-  if (text == NULL)
-  {
-    this->inputLine = new char[1];
-    this->inputLine[0] = '\0';
-  }
-  else
-  {
-    this->inputLine = new char[strlen(text)+1];
-    strcpy(this->inputLine, text);
-  }
-  this->setText(this->inputLine, true);
+void ShellInput::setInputText(const std::string& text)
+{
+  this->inputLine = text;
+  this->setText(this->inputLine);
 }
 
@@ -134,15 +116,10 @@
   if (this->historyScrolling)
   {
-    delete[] this->history.back();
     this->history.pop_back();
     this->historyScrolling = false;
   }
 
-  char* addCharLine = new char[strlen(this->inputLine)+2];
-
-  sprintf(addCharLine, "%s%c", this->inputLine, character);
-  delete[] this->inputLine;
-  this->inputLine = addCharLine;
-  this->setText(this->inputLine, true);
+  this->inputLine += character;
+  this->setText(this->inputLine);
 }
 
@@ -151,19 +128,14 @@
  * @param characters a \\0 terminated char-array to add to the InputLine
  */
-void ShellInput::addCharacters(const char* characters)
+void ShellInput::addCharacters(const std::string& characters)
 {
   if (this->historyScrolling)
   {
-    delete[] this->history.back();
     this->history.pop_back();
     this->historyScrolling = false;
   }
 
-  char* addCharLine = new char[strlen(this->inputLine)+strlen(characters)+1];
-
-  sprintf(addCharLine, "%s%s", this->inputLine, characters);
-  delete[] this->inputLine;
-  this->inputLine = addCharLine;
-  this->setText(this->inputLine, true);
+  this->inputLine += characters;
+  this->setText(this->inputLine);
 }
 
@@ -176,22 +148,12 @@
   if (this->historyScrolling)
   {
-    delete[] this->history.back();
     this->history.pop_back();
     this->historyScrolling = false;
   }
-
-  if (strlen(this->inputLine) == 0)
-    return;
-
-  if (characterCount > strlen(this->inputLine))
-    characterCount = strlen(this->inputLine);
-
-  char* removeCharLine = new char[strlen(this->inputLine)-characterCount+1];
-
-  strncpy(removeCharLine, this->inputLine, strlen(this->inputLine)-characterCount);
-  removeCharLine[strlen(this->inputLine)-characterCount] = '\0';
-  delete[] this->inputLine;
-  this->inputLine = removeCharLine;
-  this->setText(this->inputLine, true);
+  if (this->inputLine.size() < characterCount)
+    characterCount = this->inputLine.size();
+
+  this->inputLine.erase(this->inputLine.size() - characterCount, this->inputLine.size());
+  this->setText(this->inputLine);
 }
 
@@ -202,18 +164,14 @@
 bool ShellInput::executeCommand()
 {
-  ShellBuffer::addBufferLineStatic("Execute Command: %s\n", this->inputLine);
-
-  if (strlen(this->inputLine) == 0)
+  ShellBuffer::addBufferLineStatic("Execute Command: %s\n", this->inputLine.c_str());
+
+  if (this->inputLine.empty())
     return false;
 
-  char* newCommand = new char[strlen(this->inputLine)+1];
-  strcpy(newCommand, this->inputLine);
-
-  ShellCommand::execute(newCommand);
+  ShellCommand::execute(this->inputLine);
 
   // removing the eventually added Entry (from scrolling) to the List
   if (this->historyScrolling)
   {
-    delete[] this->history.back();
     this->history.pop_back();
     this->historyScrolling = false;
@@ -221,8 +179,7 @@
 
   // adding the new Command to the History
-  this->history.push_back(newCommand);
+  this->history.push_back(this->inputLine);
   if (this->history.size() > this->historyLength)
   {
-    delete[] this->history.front();
     this->history.pop_front();
   }
@@ -241,7 +198,5 @@
   if (!this->historyScrolling)
   {
-    char* currentText = new char[strlen(this->inputLine)+1];
-    strcpy(currentText, this->inputLine);
-    this->history.push_back(currentText);
+    this->history.push_back(this->inputLine);
     this->historyScrolling = true;
     this->historyIT = --this->history.end();
@@ -250,8 +205,8 @@
   if(this->historyIT != this->history.begin())
   {
-    char* prevElem = *(--this->historyIT);
-    if (prevElem == NULL)
+    std::string prevElem = *(--this->historyIT);
+    /*if (prevElem == NULL) /// TODO STD
       return;
-    else
+    else */
     {
       this->flush();
@@ -270,8 +225,8 @@
   if (this->historyIT != this->history.end())
   {
-    char* nextElem = *(++this->historyIT);
-    if (nextElem == NULL)
+    std::string nextElem = *(++this->historyIT);
+    /*    if (nextElem == NULL) /// TODO FIX STD
       return;
-    else
+    else */
     {
       this->flush();
@@ -285,9 +240,9 @@
  * prints out some nice help about the Shell
  */
-void ShellInput::help(const char* className, const char* functionName)
-{
-  printf("%s::%s\n", className, functionName);
-
-  if (strlen(className) == 0)
+void ShellInput::help(const std::string& className, const std::string& functionName)
+{
+  printf("%s::%s\n", className.c_str(), functionName.c_str());
+
+  if (className.empty())
   {
     PRINT(0)("Help for the most important Shell-commands\n");
@@ -298,5 +253,5 @@
     PRINT(0)("- Also try 'help className'");
   }
-  else if (strlen (className) > 0 && strlen (functionName) == 0)
+  else if (!className.empty() && functionName.empty())
   {
     ShellCommandClass::help(className);
