/*
    kwintv, Video4Linux based TV application

    Copyright (C) 1998,1999 Moritz Wenk (wenk@mathematik.uni-kl.de)

    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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef parsecl_h
#define parsecl_h

#include <qstring.h>
#include <qlist.h>
#include <qstrlist.h>

struct option
{
  QString olong, oshort;
  QString options, help;
  int oid;
};

class parsecl
{
public:
  parsecl(int _argc=0, char **_argv=NULL);
  ~parsecl();

  bool parse();
  bool addOption( int oid, const char * oshort, const char * olong,
		  const char * options, const char * help );

  bool checkOptionBool( int oid, bool odefault );
  int checkOptionInt( int oid, int odefault );
  const char * checkOptionStr( int oid, const char * odefault );
  bool checkOptionSwitch( int oid, bool odefault  );

private:
  int argc;
  char **argv;

  QStrList * list;

  QList<option> * oplist;
};

#endif
