Index: code/branches/input/src/util/ArgReader.cc
===================================================================
--- code/branches/input/src/util/ArgReader.cc	(revision 945)
+++ code/branches/input/src/util/ArgReader.cc	(revision 945)
@@ -0,0 +1,109 @@
+/*
+ *   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"
+
+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 = (float)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/input/src/util/ArgReader.h
===================================================================
--- code/branches/input/src/util/ArgReader.h	(revision 945)
+++ code/branches/input/src/util/ArgReader.h	(revision 945)
@@ -0,0 +1,59 @@
+/*
+ *   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>
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+ @file  Argreader.h
+ @brief reads arguments
+ @author Benjamin Knecht <beni_at_orxonox.net>
+ */
+
+#ifndef _ArgReader_H__
+#define _ArgReader_H__
+
+#include <string>
+
+#include "UtilPrereqs.h"
+
+class _UtilExport ArgReader
+{
+  public:
+    ArgReader(int argc, char **argv);
+    void checkArgument(std::string option, std::string& string, bool must=false);
+    void checkArgument(std::string option, int& integer, bool must=false);
+    void checkArgument(std::string option, float& floating, bool must=false);
+    bool errorHandling();
+  private:
+    int checkOption(std::string option);
+
+  private:
+    int counter_;
+    char **arguments_;
+    bool fail_;
+    std::string errorStr_;
+};
+
+#endif /* _ArgReader_H__ */
Index: code/branches/input/src/util/CMakeLists.txt
===================================================================
--- code/branches/input/src/util/CMakeLists.txt	(revision 943)
+++ code/branches/input/src/util/CMakeLists.txt	(revision 945)
@@ -4,4 +4,5 @@
 
 SET (UTIL_SRC_FILES
+  ArgReader.cc
   Math.cc
   String.cc
Index: code/branches/input/src/util/UtilPrereqs.h
===================================================================
--- code/branches/input/src/util/UtilPrereqs.h	(revision 943)
+++ code/branches/input/src/util/UtilPrereqs.h	(revision 945)
@@ -27,7 +27,7 @@
 
 /**
- @file  UtilPrereq.h
- @brief Contains all the necessary forward declarations for all classes, structs and enums.
- */
+  @file
+  @brief Contains all the necessary forward declarations for all classes and structs.
+*/
 
 #ifndef _UtilPrereqs_H__
@@ -59,4 +59,5 @@
 // Forward declarations
 //-----------------------------------------------------------------------
+class ArgReader;
 class Convert;
 template <typename FromType, typename ToType>
