Index: trunk/src/lib/parser/ini_parser/ini_parser.cc
===================================================================
--- trunk/src/lib/parser/ini_parser/ini_parser.cc	(revision 5951)
+++ trunk/src/lib/parser/ini_parser/ini_parser.cc	(revision 5952)
@@ -287,4 +287,6 @@
 bool IniParser::addSection(const char* sectionName)
 {
+  if (sectionName == NULL)
+    return false;
   this->sections.push_back(IniSection());
   this->sections.back().comment = NULL;
@@ -307,13 +309,12 @@
 bool IniParser::getSection(const char* sectionName)
 {
-  std::list<IniSection>::iterator section;
-  for (section = this->sections.begin(); section != this->sections.end(); section++)
-    if (!strcmp((*section).name, sectionName))
-      {
-	this->currentSection = section;
-	this->currentEntry = (*this->currentSection).entries.begin();
-	return true;
-      }
-  return false;
+  this->currentSection = this->getSectionIT(sectionName);
+  if (this->currentSection != this->sections.end())
+  {
+    this->currentEntry = (*this->currentSection).entries.begin();
+    return true;
+  }
+  else
+    return false;
 }
 
@@ -323,14 +324,30 @@
 void IniParser::setSectionComment(const char* comment, const char* sectionName)
 {
-
-
-}
-
-/**
- *
+  std::list<IniSection>::iterator section = this->getSectionIT(sectionName);
+  if (section == this->sections.end())
+    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;
+}
+
+/**
+ * @param sectionName the Section to query for
+ * @returns the Comment, or NULL on error.
  */
 const char* IniParser::getSectionComment(const char* sectionName) const
 {
-
+  std::list<IniSection>::const_iterator section = this->getSectionIT(sectionName);
+  if (section != this->sections.end())
+    return (*section).comment;
+  else
+    return NULL;
 }
 
@@ -430,21 +447,12 @@
   if (this->fileName != NULL)
   {
-    std::list<IniSection>::const_iterator section = this->getSectionIT(sectionName);
-
-  if (section == this->sections.end())
-    {
-      PRINTF(2)("Section %s that should be containing %s not found.\n", sectionName, entryName);
-      return (defaultValue);
-    }
-
-    std::list<IniEntry>::const_iterator entry;
-    for (entry = (*section).entries.begin(); entry != (*section).entries.end(); entry++)
-      if (!strcmp((*entry).name, entryName))
-        return (*entry).value;
+    std::list<IniEntry>::const_iterator entry = this->getEntryIT(entryName, sectionName);
+    if (!strcmp((*entry).name, entryName))
+      return (*entry).value;
     PRINTF(2)("Entry '%s' in section '%s' not found.\n", entryName, sectionName);
 
   }
   else
-    PRINTF(2)("%s not opened\n", fileName);
+    PRINTF(2)("no File opened\n");
 
   return defaultValue;
@@ -454,18 +462,35 @@
 /**
  * Set the Comment of a specified Entry.
- */
-const char* IniParser::setEntryComment(const char* comment, const char* entryName, const char* sectionName)
-{
-
-
-}
-
-/**
- *
+ * @param comment the Comment to set
+ * @param entryName the Name of the Entry
+ * @param sectionName the Name of the Section
+ */
+void IniParser::setEntryComment(const char* comment, const char* entryName, const char* 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;
+
+
+}
+
+/**
+ * @param entryName the Entry to query for
+ * @param sectionName the Section to Query for
+ * @returns the queried Comment.
  */
 const char* IniParser::getEntryComment(const char* entryName, const char* sectionName) const
 {
-
-
+  std::list<IniEntry>::const_iterator entry = this->getEntryIT(entryName, sectionName);
+
+  return (*entry).comment;
 }
 
@@ -550,5 +575,7 @@
 {
   std::list<IniSection>::const_iterator section = this->currentSection;
-  if (sectionName != NULL)
+  if (sectionName == NULL)
+    return this->currentSection;
+  else
     for (section = this->sections.begin(); section != this->sections.end(); section++)
       if (!strcmp((*section).name, sectionName))
@@ -565,5 +592,7 @@
 {
   std::list<IniSection>::iterator section = this->currentSection;
-  if (sectionName != NULL)
+  if (sectionName == NULL)
+    return this->currentSection;
+  else
     for (section = this->sections.begin(); section != this->sections.end(); section++)
       if (!strcmp((*section).name, sectionName))
Index: trunk/src/lib/parser/ini_parser/ini_parser.h
===================================================================
--- trunk/src/lib/parser/ini_parser/ini_parser.h	(revision 5951)
+++ trunk/src/lib/parser/ini_parser/ini_parser.h	(revision 5952)
@@ -68,5 +68,5 @@
     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;
-    const char* setEntryComment(const char* comment, const char* entryName, const char* sectionName);
+    void setEntryComment(const char* comment, const char* entryName, const char* sectionName);
     const char* getEntryComment(const char* entryName, const char* sectionName) const;
 
