Index: /code/branches/FICN/src/orxonox/core/ArgReader.cc
===================================================================
--- /code/branches/FICN/src/orxonox/core/ArgReader.cc	(revision 543)
+++ /code/branches/FICN/src/orxonox/core/ArgReader.cc	(revision 543)
@@ -0,0 +1,113 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+ @file  ArgReader.cc
+ @brief Argument Reader
+ */
+
+#include <iostream>
+
+#include "ArgReader.h"
+
+namespace orxonox {
+
+  ArgReader::ArgReader(int argc, char** argv)
+  {
+    counter_ = argc;
+    arguments_ = argv;
+    fail_ = false;
+    errorStr_ = "";
+  }
+
+  void ArgReader::checkArgument(std::string option, std::string &string, bool must)
+  {
+    int argpos = checkOption(option) + 1;
+    if(argpos != 0)
+    {
+      string = arguments_[argpos];
+    }
+    else
+    {
+      if(must) {
+        errorStr_ = errorStr_ + "Cannot find mandatory argument \"" + option + "\"\n";
+        fail_ = true;
+      }
+    }
+
+  }
+
+  void ArgReader::checkArgument(std::string option, int &integer, bool must)
+  {
+    int argpos = checkOption(option) + 1;
+    if(argpos != 0)
+    {
+      integer = atoi(arguments_[argpos]);
+    }
+    else
+    {
+      if(must) {
+        errorStr_ = errorStr_ + "Cannot find mandatory argument \"" + option + "\"\n";
+        fail_ = true;
+      }
+    }
+  }
+
+  void ArgReader::checkArgument(std::string option, float &floating, bool must)
+  {
+    int argpos = checkOption(option) + 1;
+    if(argpos != 0)
+    {
+      floating = atof(arguments_[argpos]);
+    }
+    else
+    {
+      if(must) {
+        errorStr_ = errorStr_ + "Cannot find mandatory argument \"" + option + "\"\n";
+        fail_ = true;
+      }
+    }
+  }
+
+  int ArgReader::checkOption(std::string option)
+  {
+    for(int i = 1; i < counter_; i++)
+    {
+      if(arguments_[i] == "--" + option)
+          return i;
+    }
+    return -1;
+  }
+
+  bool ArgReader::errorHandling()
+  {
+    if(fail_)
+      std::cout << errorStr_;
+    return fail_;
+  }
+}
+
Index: /code/branches/FICN/src/orxonox/core/ArgReader.h
===================================================================
--- /code/branches/FICN/src/orxonox/core/ArgReader.h	(revision 543)
+++ /code/branches/FICN/src/orxonox/core/ArgReader.h	(revision 543)
@@ -0,0 +1,33 @@
+/**
+ @file  Argreader.h
+ @brief reads arguments
+ @author Benjamin Knecht <beni_at_orxonox.net>
+ */
+
+#ifndef __ARGREADER_CLASS__
+#define __ARGREADER_CLASS__
+
+#include <string>
+
+namespace orxonox {
+
+  class ArgReader
+  {
+    public:
+      ArgReader(int argc, char **argv);
+      void checkArgument(std::string option, std::string& string, bool must);
+      void checkArgument(std::string option, int& integer, bool must);
+      void checkArgument(std::string option, float& floating, bool must);
+      bool errorHandling();
+    private:
+      int checkOption(std::string option);
+
+    private:
+      int counter_;
+      char **arguments_;
+      bool fail_;
+      std::string errorStr_;
+  };
+
+}
+#endif
