Index: trunk/src/lib/parser/ini_parser/ini_parser.cc
===================================================================
--- trunk/src/lib/parser/ini_parser/ini_parser.cc	(revision 6981)
+++ trunk/src/lib/parser/ini_parser/ini_parser.cc	(revision 7221)
@@ -40,10 +40,10 @@
  * @param fileName: the path and name of the file to parse
  */
-IniParser::IniParser (const char* fileName)
-{
-  this->fileName = NULL;
-  this->comment = NULL;
-
-  if (fileName != NULL)
+IniParser::IniParser (const std::string& fileName)
+{
+  this->fileName = "";
+  this->comment = "";
+
+  if (!fileName.empty())
     this->readFile(fileName);
 }
@@ -56,6 +56,8 @@
 {
   this->deleteSections();
-  this->setFileName(NULL);
-}
+  this->setFileName("");
+}
+
+const std::string IniParser::emptyString = "";
 
 
@@ -66,25 +68,8 @@
 {
   // in all sections
-  while(!this->sections.empty())
-  {
-     IniSection section = this->sections.front();
-
-    // in all entries of the sections
-    while(!section.entries.empty())
-    {
-      // delete all strings of entries.
-      IniEntry entry = section.entries.front();
-      delete[] entry.name;
-      delete[] entry.value;
-      delete[] entry.comment;
-      section.entries.pop_front();
-    }
-    // delete all Sections
-    delete[] section.name;
-    delete[] section.comment;
-    this->sections.pop_front();
-  }
+  this->sections.clear();
+
   this->currentSection = this->sections.end();
-  this->setFileName(NULL);
+  this->setFileName("");
 }
 
@@ -95,19 +80,8 @@
  * If fileName is NULL the new Name will be set to NULL too.
  */
-void IniParser::setFileName(const char* fileName)
-{
-  if (this->fileName != NULL)
-    delete[] this->fileName;
-  if  (this->comment != NULL)
-    delete[] this->comment;
-  this->comment = NULL;
-
-  if (fileName != NULL)
-  {
-    this->fileName = new char[strlen(fileName)+1];
-    strcpy(this->fileName, fileName);
-  }
-  else
-    this->fileName = NULL;
+void IniParser::setFileName(const std::string& fileName)
+{
+  this->comment = "";
+  this->fileName = fileName;
 }
 
@@ -121,17 +95,18 @@
  * and the new one will be opened.
  */
-bool IniParser::readFile(const char* fileName)
+bool IniParser::readFile(const std::string& fileName)
 {
   FILE*    stream;           //< The stream we use to read the file.
   int      lineCount = 0;    //< The Count of lines.
 
-  if (this->fileName != NULL)
+  if (!this->fileName.empty())
     this->deleteSections();
-  if( fileName == NULL)
-    return false;
-
-  if( (stream = fopen (fileName, "r")) == NULL)
-  {
-    PRINTF(1)("IniParser could not open %s\n", fileName);
+
+  if( fileName.empty())
+    return false;
+
+  if( (stream = fopen (fileName.c_str(), "r")) == NULL)
+  {
+    PRINTF(1)("IniParser could not open %s\n", fileName.c_str());
     return false;
   }
@@ -143,6 +118,6 @@
     // READING IN THE INI-FILE //
     /////////////////////////////
-    char lineBuffer[PARSELINELENGHT];
-    char buffer[PARSELINELENGHT];
+    char lineBuffer[PARSELINELENGHT+1];
+    char buffer[PARSELINELENGHT+1];
     const char* lineBegin;
     char* ptr;
@@ -154,13 +129,17 @@
       if( (ptr = strchr( lineBuffer, '\n')) != NULL)
         *ptr = 0;
+      else
+        lineBuffer[PARSELINELENGHT] = 0;
       // cut up to the beginning of the line.
       while((*lineBegin == ' ' || *lineBegin == '\t') && lineBegin < lineBuffer + strlen(lineBuffer))
         ++lineBegin;
 
+      if ( !strcmp( lineBegin, "" ) )
+        continue;
+
       // check if we have a FileComment
       if ( (*lineBegin == '#' || *lineBegin == ';'))
       {
-        char* newCommenLine = new char[strlen(lineBegin)+1];
-        strcpy(newCommenLine, lineBegin);
+        string newCommenLine = lineBegin;
         this->commentList.push_back(newCommenLine);
         continue;
@@ -191,5 +170,6 @@
           continue;
         }
-        if( ptr == lineBegin) {
+        if( ptr == lineBegin)
+        {
           lineCount++;
           continue;
@@ -228,53 +208,43 @@
  * @return true on success false otherwise
  */
-bool IniParser::writeFile(const char* fileName) const
+bool IniParser::writeFile(const std::string& fileName) const
 {
   FILE*    stream;           //!< The stream we use to read the file.
-  if( fileName == NULL && (fileName = this->fileName) == NULL )
-    return false;
-
-  if( (stream = fopen (fileName, "w")) == NULL)
-  {
-    PRINTF(1)("IniParser could not open %s\n", fileName);
-    return false;
-  }
-  else
-  {
-    if (this->comment != NULL)
-      fprintf(stream, "%s\n\n", this->comment);
+  if( fileName.empty())
+    return false;
+
+  if( (stream = fopen (fileName.c_str(), "w")) == NULL)
+  {
+    PRINTF(1)("IniParser could not open %s\n", fileName.c_str());
+    return false;
+  }
+  else
+  {
+    if (!this->comment.empty())
+      fprintf(stream, "%s\n\n", this->comment.c_str());
 
     std::list<IniSection>::const_iterator section;
     for (section = this->sections.begin(); section != this->sections.end(); section++)
+    {
+      if (!(*section).comment.empty())
+        fprintf(stream, "%s", (*section).comment.c_str());
+      fprintf(stream, "\n [%s]\n", (*section).name.c_str());
+
+      std::list<IniEntry>::const_iterator entry;
+      for (entry = (*section).entries.begin(); entry != (*section).entries.end(); entry++)
       {
-        if ((*section).comment != NULL)
-          fprintf(stream, "%s", (*section).comment);
-        fprintf(stream, "\n [%s]\n", (*section).name);
-
-        std::list<IniEntry>::const_iterator entry;
-        for (entry = (*section).entries.begin(); entry != (*section).entries.end(); entry++)
-        {
-          if ((*entry).comment != NULL)
-            fprintf(stream, "%s", (*entry).comment);
-          fprintf(stream, "   %s = %s\n", (*entry).name, (*entry).value);
-         }
+        if (!(*entry).comment.empty())
+          fprintf(stream, "%s", (*entry).comment.c_str());
+        fprintf(stream, "   %s = %s\n", (*entry).name.c_str(), (*entry).value.c_str());
       }
+    }
   }
   fclose(stream);
 }
 
-void IniParser::setFileComment(const char* fileComment)
-{
-  if (this->comment != NULL)
-    delete this->comment;
-
-  if (fileComment != NULL)
-  {
-    this->comment = new char[strlen(fileComment)+1];
-    strcpy(this->comment, fileComment);
-  }
-  else
-    this->comment = NULL;
-}
-
+void IniParser::setFileComment(const std::string& fileComment)
+{
+  this->comment = fileComment;
+}
 
 /**
@@ -284,17 +254,18 @@
  * @return true on success... there is only success or segfault :)
  */
-bool IniParser::addSection(const char* sectionName)
-{
-  if (sectionName == NULL)
-    return false;
-  this->sections.push_back(IniSection());
-  this->sections.back().comment = NULL;
-  this->sections.back().name = new char[strlen(sectionName)+1];
-  strcpy(this->sections.back().name, sectionName);
+bool IniParser::addSection(const std::string& sectionName)
+{
+  if (sectionName.empty())
+    return false;
+  IniSection newSection;
+  newSection.name = sectionName;
+  newSection.comment = "";
+
+  this->sections.push_back(newSection);
 
   this->currentSection = --this->sections.end();
   if (!this->sections.empty())
-      this->currentEntry = (*this->currentSection).entries.begin();
-  PRINTF(5)("Added Section %s\n", sectionName);
+    this->currentEntry = (*this->currentSection).entries.begin();
+  PRINTF(5)("Added Section %s\n", sectionName.c_str());
   return true;
 }
@@ -306,5 +277,5 @@
  * @return true on success or false if the section could not be found
  */
-bool IniParser::getSection(const char* sectionName)
+bool IniParser::getSection(const std::string& sectionName)
 {
   this->currentSection = this->getSectionIT(sectionName);
@@ -321,5 +292,5 @@
  *
  */
-void IniParser::setSectionComment(const char* comment, const char* sectionName)
+void IniParser::setSectionComment(const std::string& comment, const std::string& sectionName)
 {
   std::list<IniSection>::iterator section = this->getSectionIT(sectionName);
@@ -327,13 +298,5 @@
     return;
 
-  if ((*section).comment != NULL)
-    delete[] (*section).comment;
-  if (comment != NULL)
-  {
-    (*section).comment = new char[strlen (comment)+1];
-    strcpy((*section).comment, comment);
-  }
-  else
-    (*section).comment = NULL;
+  (*section).comment = comment;
 }
 
@@ -342,5 +305,5 @@
  * @returns the Comment, or NULL on error.
  */
-const char* IniParser::getSectionComment(const char* sectionName) const
+const std::string& IniParser::getSectionComment(const std::string& sectionName) const
 {
   std::list<IniSection>::const_iterator section = this->getSectionIT(sectionName);
@@ -348,5 +311,5 @@
     return (*section).comment;
   else
-    return NULL;
+    return IniParser::emptyString;
 }
 
@@ -367,18 +330,18 @@
  * @returns the name of the section if found, NULL otherwise
  */
-const char* IniParser::nextSection()
+const std::string& IniParser::nextSection()
 {
   if (this->currentSection == this->sections.end())
-    return NULL;
+    return IniParser::emptyString;
 
   this->currentSection++;
 
   if (this->currentSection != this->sections.end())
-    {
-      this->currentEntry = (*this->currentSection).entries.begin();
-      return this->currentSection->name;
-    }
-  else
-    return NULL;
+  {
+    this->currentEntry = (*this->currentSection).entries.begin();
+    return this->currentSection->name;
+  }
+  else
+    return IniParser::emptyString;
 }
 
@@ -393,12 +356,12 @@
  * @return true if everything is ok false on error
  */
-bool IniParser::addVar(const char* entryName, const char* value, const char* sectionName)
+bool IniParser::addVar(const std::string& entryName, const std::string& value, const std::string& sectionName)
 {
   std::list<IniSection>::iterator section;
 
-  if (sectionName != NULL)
+  if (!sectionName.empty())
   {
     for (section = this->sections.begin(); section != this->sections.end(); section++)
-      if (!strcmp((*section).name, sectionName))
+      if ((*section).name == sectionName)
         break;
   }
@@ -411,5 +374,5 @@
   if (section == this->sections.end())
   {
-    PRINTF(2)("section '%s' not found for value '%s'\n", sectionName, entryName);
+    PRINTF(2)("section '%s' not found for value '%s'\n", sectionName.c_str(), entryName.c_str());
     return false;
   }
@@ -417,13 +380,11 @@
   {
     (*section).entries.push_back(IniEntry());
-    (*section).entries.back().comment = NULL;
-    (*section).entries.back().name = new char[strlen(entryName)+1];
-    strcpy((*section).entries.back().name, entryName);
-    (*section).entries.back().value = new char[strlen(value)+1];
-    strcpy((*section).entries.back().value, value);
+    (*section).entries.back().comment = "";
+    (*section).entries.back().name = entryName;
+    (*section).entries.back().value = value;
     PRINTF(5)("Added Entry %s with Value '%s' to Section %s\n",
-              (*section).entries.back().name,
-              (*section).entries.back().value,
-              (*section).name);
+              (*section).entries.back().name.c_str(),
+              (*section).entries.back().value.c_str(),
+              (*section).name.c_str());
     this->currentEntry = --(*section).entries.end();
     return true;
@@ -442,13 +403,12 @@
  * lead to unwanted behaviour.
 */
-const char* IniParser::getVar(const char* entryName, const char* sectionName, const char* defaultValue) const
-{
-  if (this->fileName != NULL)
+const std::string& IniParser::getVar(const std::string& entryName, const std::string& sectionName, const std::string& defaultValue) const
+{
+  if (!this->fileName.empty())
   {
     std::list<IniEntry>::const_iterator entry = this->getEntryIT(entryName, sectionName);
-    if (entry != NULL &&  !strcmp((*entry).name, entryName))
+    if (entry != NULL &&  (*entry).name == entryName)
       return (*entry).value;
-    PRINTF(2)("Entry '%s' in section '%s' not found.\n", entryName, sectionName);
-
+    PRINTF(2)("Entry '%s' in section '%s' not found.\n", entryName.c_str(), sectionName.c_str());
   }
   else
@@ -456,5 +416,4 @@
 
   return defaultValue;
-
 }
 
@@ -465,19 +424,8 @@
  * @param sectionName the Name of the Section
  */
-void IniParser::setEntryComment(const char* comment, const char* entryName, const char* sectionName)
+void IniParser::setEntryComment(const std::string& comment, const std::string& entryName, const std::string& sectionName)
 {
   std::list<IniEntry>::iterator entry = this->getEntryIT(entryName, sectionName);
-
-  if ((*entry).comment != NULL)
-    delete[] (*entry).comment;
-  if (comment != NULL)
-  {
-    (*entry).comment = new char[strlen (comment)+1];
-    strcpy((*entry).comment, comment);
-  }
-  else
-    (*entry).comment = NULL;
-
-
+  (*entry).comment = comment;
 }
 
@@ -487,5 +435,5 @@
  * @returns the queried Comment.
  */
-const char* IniParser::getEntryComment(const char* entryName, const char* sectionName) const
+const std::string& IniParser::getEntryComment(const std::string& entryName, const std::string& sectionName) const
 {
   std::list<IniEntry>::const_iterator entry = this->getEntryIT(entryName, sectionName);
@@ -501,5 +449,5 @@
 {
   if (!this->sections.empty() &&
-       this->currentSection != this->sections.end())
+      this->currentSection != this->sections.end())
     this->currentEntry = (*this->currentSection).entries.begin();
 }
@@ -530,5 +478,5 @@
  * @returns the name of the Current selected Section
  */
-const char* IniParser::getCurrentSection() const
+const std::string& IniParser::getCurrentSection() const
 {
   if (!this->sections.empty() &&
@@ -536,6 +484,6 @@
     return this->currentSection->name;
   else
-    return NULL;
- }
+    return IniParser::emptyString ;
+}
 
 
@@ -543,12 +491,12 @@
  * @returns the current entries Name, or NULL if we havn't selected a Entry
  */
-const char* IniParser::getCurrentName() const
-{
- if (!this->sections.empty() &&
-     this->currentSection != this->sections.end() &&
-     this->currentEntry != (*this->currentSection).entries.end())
-   return (*this->currentEntry).name;
- else
-   return NULL;
+const std::string& IniParser::getCurrentName() const
+{
+  if (!this->sections.empty() &&
+      this->currentSection != this->sections.end() &&
+      this->currentEntry != (*this->currentSection).entries.end())
+    return (*this->currentEntry).name;
+  else
+    return emptyString;
 }
 
@@ -556,5 +504,5 @@
  * @returns the current entries Value, or NULL if we havn't selected a Entry
  */
-const char* IniParser::getCurrentValue() const
+const std::string& IniParser::getCurrentValue() const
 {
   if (!this->sections.empty() &&
@@ -563,5 +511,5 @@
     return (*this->currentEntry).value;
   else
-    return NULL;
+    return IniParser::emptyString;
 }
 
@@ -571,12 +519,12 @@
  * @param sectionName the Name of the Section to get the Iterator from
  */
-std::list<IniParser::IniSection>::const_iterator IniParser::getSectionIT(const char* sectionName) const
+std::list<IniParser::IniSection>::const_iterator IniParser::getSectionIT(const std::string& sectionName) const
 {
   std::list<IniSection>::const_iterator section = this->currentSection;
-  if (sectionName == NULL)
+  if (sectionName.empty())
     return this->currentSection;
   else
     for (section = this->sections.begin(); section != this->sections.end(); section++)
-      if (!strcmp((*section).name, sectionName))
+      if ((*section).name == sectionName)
         break;
   return section;
@@ -588,12 +536,12 @@
  * @param sectionName the Name of the Section to get the Iterator from
  */
-std::list<IniParser::IniSection>::iterator IniParser::getSectionIT(const char* sectionName)
+std::list<IniParser::IniSection>::iterator IniParser::getSectionIT(const std::string& sectionName)
 {
   std::list<IniSection>::iterator section = this->currentSection;
-  if (sectionName == NULL)
+  if (sectionName.empty())
     return this->currentSection;
   else
     for (section = this->sections.begin(); section != this->sections.end(); section++)
-      if (!strcmp((*section).name, sectionName))
+      if ((*section).name == sectionName)
         break;
   return section;
@@ -606,7 +554,7 @@
  * @param sectionName the Name of the Section to get the Iterator from
  */
-std::list<IniParser::IniEntry>::const_iterator IniParser::getEntryIT(const char* entryName, const char* sectionName) const
-{
-  if (entryName == NULL)
+std::list<IniParser::IniEntry>::const_iterator IniParser::getEntryIT(const std::string& entryName, const std::string& sectionName) const
+{
+  if (entryName.empty())
     return this->currentEntry;
   std::list<IniSection>::const_iterator section = this->getSectionIT(sectionName);
@@ -615,5 +563,5 @@
   if (section != this->sections.end())
     for (entry = (*section).entries.begin(); entry != (*section).entries.end(); entry++)
-      if (!strcmp((*entry).name, entryName))
+      if ((*entry).name == entryName)
         break;
   if (entry == (*section).entries.end())
@@ -629,7 +577,7 @@
  * @param sectionName the Name of the Section to get the Iterator from
  */
-std::list<IniParser::IniEntry>::iterator IniParser::getEntryIT(const char* entryName, const char* sectionName)
-{
-  if (entryName == NULL)
+std::list<IniParser::IniEntry>::iterator IniParser::getEntryIT(const std::string& entryName, const std::string& sectionName)
+{
+  if (entryName.empty())
     return this->currentEntry;
   std::list<IniSection>::iterator section = this->getSectionIT(sectionName);
@@ -638,5 +586,5 @@
   if (section != this->sections.end())
     for (entry = (*section).entries.begin(); entry != (*section).entries.end(); entry++)
-      if (!strcmp((*entry).name, entryName))
+      if ((*entry).name == entryName)
         break;
   if (entry == (*section).entries.end())
@@ -652,25 +600,17 @@
 void IniParser::setFileComment()
 {
-  if (this->comment != NULL)
-    delete[] this->comment;
-
-  if (this->commentList.empty()) {
-    this->comment = NULL;
+  if (this->commentList.empty())
+  {
+    this->comment = "";
     return;
   }
 
-  unsigned int stringLength = 1;
   std::list<char*>::iterator comment;
-  for (comment = this->commentList.begin(); comment != this->commentList.end(); comment++)
-    stringLength += strlen((*comment)) +1;
-
-  this->comment = new char[stringLength];
-  this->comment[0] = '\0';
+
   while (!this->commentList.empty())
   {
-    if (*this->comment != '\0')
-      strcat(this->comment, "\n");
-    strcat(this->comment, this->commentList.front());
-    delete[] this->commentList.front();
+    if (this->comment[0] != '\0')
+      this->comment += "\n";
+    this->comment += this->commentList.front();
     this->commentList.pop_front();
   }
@@ -682,25 +622,14 @@
 void IniParser::setSectionComment()
 {
-  if ((*this->currentSection).comment != NULL)
-    delete[] (*this->currentSection).comment;
-
-  if (this->commentList.empty()) {
-    (*this->currentSection).comment = NULL;
+  (*this->currentSection).comment = "";
+
+  if (this->commentList.empty())
     return;
-  }
-
-  unsigned int stringLength = 1;
-  std::list<char*>::iterator comment;
-  for (comment = this->commentList.begin(); comment != this->commentList.end(); comment++)
-    stringLength += strlen((*comment)) +1;
-
-  (*this->currentSection).comment = new char[stringLength];
-  (*this->currentSection).comment[0] = '\0';
+
   while (!this->commentList.empty())
   {
-    if (*(*this->currentSection).comment != '\0')
-      strcat((*this->currentSection).comment, "\n");
-    strcat((*this->currentSection).comment, this->commentList.front());
-    delete[] this->commentList.front();
+    if ((*this->currentSection).comment[0] != '\0')
+      (*this->currentSection).comment += "\n";
+    (*this->currentSection).comment += this->commentList.front();
     this->commentList.pop_front();
   }
@@ -712,28 +641,15 @@
 void IniParser::setEntryComment()
 {
-  if ((*this->currentEntry).comment != NULL)
-    delete[] (*this->currentEntry).comment;
-
-  if (this->commentList.empty()) {
-    (*this->currentEntry).comment = NULL;
+  (*this->currentEntry).comment = "";
+  if (this->commentList.empty())
     return;
-  }
-
-  unsigned int stringLength = 1;
-  std::list<char*>::iterator comment;
-  for (comment = this->commentList.begin(); comment != this->commentList.end(); comment++)
-    stringLength += strlen((*comment)) +1;
-
-  (*this->currentEntry).comment = new char[stringLength];
-  (*this->currentEntry).comment[0] = '\0';
+
   while (!this->commentList.empty())
   {
-    if (*(*this->currentEntry).comment != '\0')
-      strcat((*this->currentEntry).comment, "\n");
-    strcat((*this->currentEntry).comment, this->commentList.front());
-    delete[] this->commentList.front();
+    if ((*this->currentEntry).comment[0] != '\0')
+      (*this->currentEntry).comment += "\n";
+    (*this->currentEntry).comment += this->commentList.front();
     this->commentList.pop_front();
   }
-
 }
 
@@ -744,23 +660,23 @@
 void IniParser::debug() const
 {
-  PRINTF(0)("Iniparser %s - debug\n", this->fileName);
-  if (this->comment != NULL)
-    PRINTF(0)("FileComment:\n %s\n\n", this->comment);
-
-  if (this->fileName != NULL)
+  PRINTF(0)("Iniparser %s - debug\n", this->fileName.c_str());
+  if (!this->comment.empty())
+    PRINTF(0)("FileComment:\n %s\n\n", this->comment.c_str());
+
+  if (!this->fileName.empty())
   {
     std::list<IniSection>::const_iterator section;
     for (section = this->sections.begin(); section != this->sections.end(); section++)
     {
-      if ((*section).comment != NULL)
-        PRINTF(0)(" %s\n", (*section).comment);
-      PRINTF(0)(" [%s]\n", (*section).name);
+      if (!(*section).comment.empty())
+        PRINTF(0)(" %s\n", (*section).comment.c_str());
+      PRINTF(0)(" [%s]\n", (*section).name.c_str());
 
       std::list<IniEntry>::const_iterator entry;
       for (entry = (*section).entries.begin(); entry != (*section).entries.end(); entry++)
       {
-        if ((*entry).comment != NULL)
-          PRINTF(0)(" %s\n", (*entry).comment);
-        PRINTF(0)("   '%s' -> '%s'\n", (*entry).name, (*entry).value);
+        if (!(*entry).comment.empty())
+          PRINTF(0)(" %s\n", (*entry).comment.c_str());
+        PRINTF(0)("   '%s' -> '%s'\n", (*entry).name.c_str(), (*entry).value.c_str());
       }
     }
Index: trunk/src/lib/parser/ini_parser/ini_parser.h
===================================================================
--- trunk/src/lib/parser/ini_parser/ini_parser.h	(revision 6981)
+++ trunk/src/lib/parser/ini_parser/ini_parser.h	(revision 7221)
@@ -15,4 +15,5 @@
 
 #include <list>
+#include <string>
 
 //! ini-file parser
@@ -27,7 +28,7 @@
     struct IniEntry
     {
-      char*               comment;  //!< A Comment that is appendet to the Top of this Entry.
-      char*               name;     //!< name of a given Entry
-      char*               value;    //!< value of a given Entry
+      std::string         comment;  //!< A Comment that is appendet to the Top of this Entry.
+      std::string         name;     //!< name of a given Entry
+      std::string         value;    //!< value of a given Entry
     };
 
@@ -35,6 +36,6 @@
     struct IniSection
     {
-      char*               comment;  //!< A Comment that is appendet to the Top of this Section.
-      char*               name;     //!< name of a given section
+      std::string         comment;  //!< A Comment that is appendet to the Top of this Section.
+      std::string         name;     //!< name of a given section
       std::list<IniEntry> entries;  //!< a list of entries for this section
     };
@@ -42,32 +43,32 @@
 
   public:
-    IniParser (const char* filename = NULL);
+    IniParser (const std::string& filename = "");
     virtual ~IniParser ();
 
     /** @returns true if the file is opened, false otherwise*/
-    bool isOpen() const { return (this->fileName != NULL)? true : false; };
+    bool isOpen() const { return (!this->fileName.empty())? true : false; };
     /** @returns the fileName we have opened. */
-    const char* getFileName() const { return this->fileName; };
+    const std::string& getFileName() const { return this->fileName; };
 
-    bool readFile(const char* fileName);
-    bool writeFile(const char* fileName) const;
+    bool readFile(const std::string& fileName);
+    bool writeFile(const std::string& fileName) const;
 
-    void setFileComment(const char* fileComment);
-    const char* getFileComment() const { return this->comment; };
+    void setFileComment(const std::string& fileComment);
+    const std::string& getFileComment() const { return this->comment; };
 
-    bool addSection(const char* sectionName);
-    bool getSection(const char* sectionName);
-    void setSectionComment(const char* comment, const char* sectionName);
-    const char* getSectionComment(const char* sectionNane) const;
+    bool addSection(const std::string& sectionName);
+    bool getSection(const std::string& sectionName);
+    void setSectionComment(const std::string& comment, const std::string& sectionName);
+    const std::string& getSectionComment(const std::string& sectionNane) const;
 
     // iterate through sections with these Functions
     void firstSection();
-    const char* nextSection();
+    const std::string& nextSection();
 
 
-    bool addVar(const char* entryName, const char* value, const char* sectionName = NULL);
-    const char* getVar(const char* entryName, const char* sectionName, const char* defaultValue = "") const;
-    void setEntryComment(const char* comment, const char* entryName, const char* sectionName);
-    const char* getEntryComment(const char* entryName, const char* sectionName) const;
+    bool addVar(const std::string& entryName, const std::string& value, const std::string& sectionName = "" );
+    const std::string& getVar(const std::string& entryName, const std::string& sectionName, const std::string& defaultValue = "") const;
+    void setEntryComment(const std::string& comment, const std::string& entryName, const std::string& sectionName);
+    const std::string& getEntryComment(const std::string& entryName, const std::string& sectionName) const;
 
     // iterate Through Variables with these Functions.
@@ -77,7 +78,7 @@
 
     // retrieving functions when iterating.
-    const char* getCurrentSection() const;
-    const char* getCurrentName() const;
-    const char* getCurrentValue() const;
+    const std::string& getCurrentSection() const;
+    const std::string& getCurrentName() const;
+    const std::string& getCurrentValue() const;
 
 
@@ -88,5 +89,5 @@
   private:
     void deleteSections();
-    void setFileName(const char* fileName);
+    void setFileName(const std::string& fileName);
 
     void setFileComment();
@@ -94,18 +95,21 @@
     void setEntryComment();
 
-    std::list<IniSection>::const_iterator getSectionIT(const char* sectionName) const;
-    std::list<IniSection>::iterator getSectionIT(const char* sectionName);
+    std::list<IniSection>::const_iterator getSectionIT(const std::string& sectionName) const;
+    std::list<IniSection>::iterator getSectionIT(const std::string& sectionName);
 
-    std::list<IniEntry>::const_iterator getEntryIT(const char* entryName, const char* sectionName = NULL) const;
-    std::list<IniEntry>::iterator getEntryIT(const char* entryName, const char* sectionName = NULL);
+    std::list<IniEntry>::const_iterator getEntryIT(const std::string& entryName, const std::string& sectionName = "") const;
+    std::list<IniEntry>::iterator getEntryIT(const std::string& entryName, const std::string& sectionName = "");
 
   private:
-    char*                            fileName;        //!< The name of the File that was parsed.
-    char*                            comment;         //!< A Comment for the header of this File.
+    std::string                      fileName;        //!< The name of the File that was parsed.
+    std::string                      comment;         //!< A Comment for the header of this File.
     std::list<IniSection>            sections;        //!< a list of all stored Sections of the Parser
     std::list<IniSection>::iterator  currentSection;  //!< the current selected Section
     std::list<IniEntry>::iterator    currentEntry;    //!< the current selected entry (in currentSection)
 
-    std::list<char*>                 commentList;     //!< A list of Comments. (this is for temporary saving of Comments, that are inserted in front of Sections/Entries.)
+    std::list<std::string>           commentList;     //!< A list of Comments. (this is for temporary saving of Comments, that are inserted in front of Sections/Entries.)
+
+
+    static const std::string         emptyString;
 };
 
Index: trunk/src/lib/parser/tinyxml/tinyxml.h
===================================================================
--- trunk/src/lib/parser/tinyxml/tinyxml.h	(revision 6981)
+++ trunk/src/lib/parser/tinyxml/tinyxml.h	(revision 7221)
@@ -26,4 +26,6 @@
 #ifndef TINYXML_INCLUDED
 #define TINYXML_INCLUDED
+
+#define TIXML_USE_STL
 
 #ifdef _MSC_VER
@@ -81,5 +83,5 @@
 		#define TIXML_SNSCANF  snscanf
 	#endif
-#endif	
+#endif
 
 class TiXmlDocument;
@@ -96,5 +98,5 @@
 const int TIXML_PATCH_VERSION = 2;
 
-/*	Internal structure for tracking location of items 
+/*	Internal structure for tracking location of items
 	in the XML file.
 */
@@ -110,6 +112,6 @@
 
 // Only used by Attribute::Query functions
-enum 
-{ 
+enum
+{
 	TIXML_SUCCESS,
 	TIXML_NO_ATTRIBUTE,
@@ -162,5 +164,5 @@
 	/**	All TinyXml classes can print themselves to a filestream.
 		This is a formatted print, and will insert tabs and newlines.
-		
+
 		(For an unformatted stream, use the << operator.)
 	*/
@@ -206,6 +208,6 @@
 	static const int utf8ByteTable[256];
 
-	virtual const char* Parse(	const char* p, 
-								TiXmlParsingData* data, 
+	virtual const char* Parse(	const char* p,
+								TiXmlParsingData* data,
 								TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0;
 
@@ -245,7 +247,7 @@
 
 	static const char*	SkipWhiteSpace( const char*, TiXmlEncoding encoding );
-	inline static bool	IsWhiteSpace( char c )		
-	{ 
-		return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); 
+	inline static bool	IsWhiteSpace( char c )
+	{
+		return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' );
 	}
 
@@ -334,5 +336,5 @@
     /// Field containing a generic user pointer
 	void*			userData;
-	
+
 	// None of these methods are reliable for any language except English.
 	// Good for approximation, not great for accuracy.
@@ -386,5 +388,5 @@
 
 public:
-	#ifdef TIXML_USE_STL	
+	#ifdef TIXML_USE_STL
 
 	    /** An input stream operator, for every class. Tolerant of newlines and
@@ -400,5 +402,5 @@
 		    a node to a stream is very well defined. You'll get a nice stream
 		    of output, without any extra whitespace or newlines.
-		    
+
 		    But reading is not as well defined. (As it always is.) If you create
 		    a TiXmlElement (for example) and read that from an input stream,
@@ -408,5 +410,5 @@
 		    A TiXmlDocument will read nodes until it reads a root element, and
 			all the children of that root element.
-	    */	
+	    */
 	    friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base);
 
@@ -470,9 +472,9 @@
     #ifdef TIXML_USE_STL
 	/// STL std::string form.
-	void SetValue( const std::string& _value )    
-	{	  
+	void SetValue( const std::string& _value )
+	{
 		StringToBuffer buf( _value );
-		SetValue( buf.buffer ? buf.buffer : "" );    	
-	}	
+		SetValue( buf.buffer ? buf.buffer : "" );
+	}
 	#endif
 
@@ -492,5 +494,5 @@
 	TiXmlNode* LastChild()	{ return lastChild; }
 	const TiXmlNode* LastChild( const char * value ) const;			/// The last child of this node matching 'value'. Will be null if there are no children.
-	TiXmlNode* LastChild( const char * value );	
+	TiXmlNode* LastChild( const char * value );
 
     #ifdef TIXML_USE_STL
@@ -649,5 +651,5 @@
 
 	/** Create an exact duplicate of this node and return it. The memory must be deleted
-		by the caller. 
+		by the caller.
 	*/
 	virtual TiXmlNode* Clone() const = 0;
@@ -731,5 +733,5 @@
 	/** QueryIntValue examines the value string. It is an alternative to the
 		IntValue() method with richer error checking.
-		If the value is an integer, it is stored in 'value' and 
+		If the value is an integer, it is stored in 'value' and
 		the call returns TIXML_SUCCESS. If it is not
 		an integer, it returns TIXML_WRONG_TYPE.
@@ -750,14 +752,14 @@
     #ifdef TIXML_USE_STL
 	/// STL std::string form.
-	void SetName( const std::string& _name )	
-	{	
+	void SetName( const std::string& _name )
+	{
 		StringToBuffer buf( _name );
-		SetName ( buf.buffer ? buf.buffer : "error" );	
-	}
-	/// STL std::string form.	
-	void SetValue( const std::string& _value )	
-	{	
+		SetName ( buf.buffer ? buf.buffer : "error" );
+	}
+	/// STL std::string form.
+	void SetValue( const std::string& _value )
+	{
 		StringToBuffer buf( _value );
-		SetValue( buf.buffer ? buf.buffer : "error" );	
+		SetValue( buf.buffer ? buf.buffer : "error" );
 	}
 	#endif
@@ -801,5 +803,5 @@
 /*	A class used to manage a group of attributes.
 	It is only used internally, both by the ELEMENT and the DECLARATION.
-	
+
 	The set can be changed transparent to the Element and Declaration
 	classes that use it, but NOT transparent to the Attribute
@@ -882,9 +884,9 @@
 	/** QueryIntAttribute examines the attribute - it is an alternative to the
 		Attribute() method with richer error checking.
-		If the attribute is an integer, it is stored in 'value' and 
+		If the attribute is an integer, it is stored in 'value' and
 		the call returns TIXML_SUCCESS. If it is not
 		an integer, it returns TIXML_WRONG_TYPE. If the attribute
 		does not exist, then TIXML_NO_ATTRIBUTE is returned.
-	*/	
+	*/
 	int QueryIntAttribute( const char* name, int* _value ) const;
 	/// QueryDoubleAttribute examines the attribute - see QueryIntAttribute().
@@ -913,18 +915,18 @@
 
 	/// STL std::string form.
-	void SetAttribute( const std::string& name, const std::string& _value )	
-	{	
+	void SetAttribute( const std::string& name, const std::string& _value )
+	{
 		StringToBuffer n( name );
 		StringToBuffer v( _value );
 		if ( n.buffer && v.buffer )
-			SetAttribute (n.buffer, v.buffer );	
-	}	
+			SetAttribute (n.buffer, v.buffer );
+	}
 	///< STL std::string form.
-	void SetAttribute( const std::string& name, int _value )	
-	{	
+	void SetAttribute( const std::string& name, int _value )
+	{
 		StringToBuffer n( name );
 		if ( n.buffer )
-			SetAttribute (n.buffer, _value);	
-	}	
+			SetAttribute (n.buffer, _value);
+	}
 	#endif
 
@@ -954,5 +956,5 @@
 		and concise, GetText() is limited compared to getting the TiXmlText child
 		and accessing it directly.
-	
+
 		If the first child of 'this' is a TiXmlText, the GetText()
 		returns the character string of the Text node, else null is returned.
@@ -964,10 +966,10 @@
 		@endverbatim
 
-		'str' will be a pointer to "This is text". 
-		
+		'str' will be a pointer to "This is text".
+
 		Note that this function can be misleading. If the element foo was created from
 		this XML:
 		@verbatim
-		<foo><b>This is text</b></foo> 
+		<foo><b>This is text</b></foo>
 		@endverbatim
 
@@ -975,10 +977,10 @@
 		another element. From this XML:
 		@verbatim
-		<foo>This is <b>text</b></foo> 
+		<foo>This is <b>text</b></foo>
 		@endverbatim
 		GetText() will return "This is ".
 
-		WARNING: GetText() accesses a child node - don't become confused with the 
-				 similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are 
+		WARNING: GetText() accesses a child node - don't become confused with the
+				 similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are
 				 safe type casts on the referenced node.
 	*/
@@ -1054,7 +1056,7 @@
 
 
-/** XML text. A text node can have 2 ways to output the next. "normal" output 
+/** XML text. A text node can have 2 ways to output the next. "normal" output
 	and CDATA. It will default to the mode it was parsed from the XML file and
-	you generally want to leave it alone, but you can change the output mode with 
+	you generally want to leave it alone, but you can change the output mode with
 	SetCDATA() and query it with CDATA().
 */
@@ -1063,5 +1065,5 @@
 	friend class TiXmlElement;
 public:
-	/** Constructor for text element. By default, it is treated as 
+	/** Constructor for text element. By default, it is treated as
 		normal, encoded text. If you want it be output as a CDATA text
 		element, set the parameter _cdata to 'true'
@@ -1279,5 +1281,5 @@
 		- The ErrorDesc() method will return the name of the error. (very useful)
 		- The ErrorRow() and ErrorCol() will return the location of the error (if known)
-	*/	
+	*/
 	bool Error() const						{ return error; }
 
@@ -1290,5 +1292,5 @@
 	int ErrorId()	const				{ return errorId; }
 
-	/** Returns the location (if known) of the error. The first column is column 1, 
+	/** Returns the location (if known) of the error. The first column is column 1,
 		and the first row is row 1. A value of 0 means the row and column wasn't applicable
 		(memory errors, for example, have no row/column) or the parser lost the error. (An
@@ -1303,5 +1305,5 @@
 		to report the correct values for row and column. It does not change the output
 		or input in any way.
-		
+
 		By calling this method, with a tab size
 		greater than 0, the row and column of each node and attribute is stored
@@ -1331,9 +1333,9 @@
 		state is automatically cleared if you Parse a new XML block.
 	*/
-	void ClearError()						{	error = false; 
-												errorId = 0; 
-												errorDesc = ""; 
-												errorLocation.row = errorLocation.col = 0; 
-												//errorLocation.last = 0; 
+	void ClearError()						{	error = false;
+												errorId = 0;
+												errorDesc = "";
+												errorLocation.row = errorLocation.col = 0;
+												//errorLocation.last = 0;
 											}
 
@@ -1381,5 +1383,5 @@
 	@endverbatim
 
-	Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very 
+	Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very
 	easy to write a *lot* of code that looks like:
 
@@ -1401,5 +1403,5 @@
 
 	And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity
-	of such code. A TiXmlHandle checks for null	pointers so it is perfectly safe 
+	of such code. A TiXmlHandle checks for null	pointers so it is perfectly safe
 	and correct to use:
 
@@ -1422,5 +1424,5 @@
 
 	@verbatim
-	int i=0; 
+	int i=0;
 	while ( true )
 	{
@@ -1433,6 +1435,6 @@
 	@endverbatim
 
-	It seems reasonable, but it is in fact two embedded while loops. The Child method is 
-	a linear walk to find the element, so this code would iterate much more than it needs 
+	It seems reasonable, but it is in fact two embedded while loops. The Child method is
+	a linear walk to find the element, so this code would iterate much more than it needs
 	to. Instead, prefer:
 
@@ -1464,18 +1466,18 @@
 	TiXmlHandle FirstChildElement( const char * value ) const;
 
-	/** Return a handle to the "index" child with the given name. 
+	/** Return a handle to the "index" child with the given name.
 		The first child is 0, the second 1, etc.
 	*/
 	TiXmlHandle Child( const char* value, int index ) const;
-	/** Return a handle to the "index" child. 
+	/** Return a handle to the "index" child.
 		The first child is 0, the second 1, etc.
 	*/
 	TiXmlHandle Child( int index ) const;
-	/** Return a handle to the "index" child element with the given name. 
+	/** Return a handle to the "index" child element with the given name.
 		The first child element is 0, the second 1, etc. Note that only TiXmlElements
 		are indexed: other types are not counted.
 	*/
 	TiXmlHandle ChildElement( const char* value, int index ) const;
-	/** Return a handle to the "index" child element. 
+	/** Return a handle to the "index" child element.
 		The first child element is 0, the second 1, etc. Note that only TiXmlElements
 		are indexed: other types are not counted.
@@ -1492,5 +1494,5 @@
 
 	/// Return the handle as a TiXmlNode. This may return null.
-	TiXmlNode* Node() const			{ return node; } 
+	TiXmlNode* Node() const			{ return node; }
 	/// Return the handle as a TiXmlElement. This may return null.
 	TiXmlElement* Element() const	{ return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); }
