Index: trunk/src/lib/parser/ini_parser/ini_parser.cc
===================================================================
--- trunk/src/lib/parser/ini_parser/ini_parser.cc	(revision 5945)
+++ trunk/src/lib/parser/ini_parser/ini_parser.cc	(revision 5946)
@@ -144,6 +144,4 @@
     while( fgets (lineBuffer, PARSELINELENGHT, stream))
     {
-//      if (lineCount == 0)
-
       lineBegin = lineBuffer;
       // remove newline char, and \0-terminate
@@ -153,6 +151,20 @@
       while((*lineBegin == ' ' || *lineBegin == '\t') && lineBegin < lineBuffer + strlen(lineBuffer))
         ++lineBegin;
-      if (strlen(lineBegin) <= 1 || *lineBegin == '#' || *lineBegin == ';')
-        continue;//printf("empty Line\n");
+
+      // check if we have a FileComment
+      if ( (*lineBegin == '#' || *lineBegin == ';'))
+      {
+        printf("___________%d_____%s\n", lineCount,lineBegin);
+        char* newCommenLine = new char[strlen(lineBegin)+1];
+        strcpy(newCommenLine, lineBegin);
+        this->commentList.push_back(newCommenLine);
+        continue;
+      }
+      if (lineCount == 0 && !this->commentList.empty())
+      {
+        this->setFileComment();
+        lineCount++;
+      }
+
       // check for section identifyer
       else if( sscanf (lineBegin, "[%s", buffer) == 1)
@@ -162,4 +174,5 @@
           *ptr = 0;
           this->addSection(buffer);
+          this->setSectionComment();
         }
       }
@@ -170,8 +183,11 @@
         {
           PRINTF(2)("Not in a Section yet for %s\n", lineBegin);
+          lineCount++;
           continue;
         }
-        if( ptr == lineBegin)
+        if( ptr == lineBegin) {
+          lineCount++;
           continue;
+        }
         char* valueBegin = ptr+1;
         while ((*valueBegin == ' ' || *valueBegin == '\t') && valueBegin <= lineBegin + strlen(lineBegin))
@@ -187,4 +203,5 @@
 
         this->addVar(lineBegin, valueBegin);
+        this->setEntryComment();
 
         lineCount++;
@@ -234,5 +251,14 @@
 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;
 }
 
@@ -247,5 +273,5 @@
 {
   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);
@@ -355,4 +381,5 @@
   {
     (*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);
@@ -363,4 +390,5 @@
               (*section).entries.back().value,
               (*section).name);
+    this->currentEntry = --(*section).entries.end();
     return true;
   }
@@ -520,4 +548,90 @@
 
 
+void IniParser::setFileComment()
+{
+  if (this->comment != NULL)
+    delete[] this->comment;
+
+  if (this->commentList.empty()) {
+    this->comment = NULL;
+    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();
+    this->commentList.pop_front();
+    printf("this->comment:: %s\n", this->comment);
+  }
+}
+
+void IniParser::setSectionComment()
+{
+  if ((*this->currentSection).comment != NULL)
+    delete[] (*this->currentSection).comment;
+
+  if (this->commentList.empty()) {
+    (*this->currentSection).comment = NULL;
+    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();
+    this->commentList.pop_front();
+    printf("this->comment:: %s", (*this->currentSection).comment);
+  }
+}
+
+void IniParser::setEntryComment()
+{
+  if ((*this->currentEntry).comment != NULL)
+    delete[] (*this->currentEntry).comment;
+
+  if (this->commentList.empty()) {
+    (*this->currentEntry).comment = NULL;
+    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();
+    this->commentList.pop_front();
+    printf("=======this->comment:: %s\n", (*this->currentEntry).comment);
+  }
+
+}
+
+
 /**
  * @brief output the whole tree in a nice and easy way.
@@ -526,4 +640,7 @@
 {
   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)
   {
@@ -531,9 +648,15 @@
     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);
 
       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);
+      }
     }
   }
@@ -542,3 +665,2 @@
 }
 
-
Index: trunk/src/lib/parser/ini_parser/ini_parser.h
===================================================================
--- trunk/src/lib/parser/ini_parser/ini_parser.h	(revision 5945)
+++ trunk/src/lib/parser/ini_parser/ini_parser.h	(revision 5946)
@@ -90,4 +90,8 @@
     void setFileName(const char* fileName);
 
+    void setFileComment();
+    void setSectionComment();
+    void setEntryComment();
+
     std::list<IniSection>::const_iterator getSectionIT(const char* sectionName) const;
     std::list<IniEntry>::const_iterator getEntryIT(const char* entryName, const char* sectionName = NULL) const;
