/*
 *
 *
 *    arguments.h
 *
 *    C++ source code for arguments class to turn command-line arguments
 *    into usable information.
 *
 *    =========================================================================
 *
 *    Copyright (C) 1999-2003 by Matt Roberts, KK5JY.
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation; either
 *    version 2.1 of the License, or (at your option) any later version.
 *
 *    This library 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
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *    =========================================================================
 *
 *
 */


#ifndef __ARGUMENTS_H
#define __ARGUMENTS_H
	#include <stdio.h>
	#include <string.h>
	#include <stdlib.h>

	#include <list>
	#include <string>


	namespace my {

		/*
		 *
		 *  class arguments
		 *
		 */

		class arguments {
			private:
				struct ArgumentValue {
					std::string name;
					std::string value;
					ArgumentValue (void) { /* noop */ };
				};

				typedef std::list<ArgumentValue> ArgumentList;
				ArgumentList arglist;

			public: // public [cd]tors
				arguments (int argc, char **argv, char *valid_args = 0, char *valid_args_with_values = 0);
				arguments (const arguments &a) { arglist = a.arglist; };
				~arguments (void) { /* noop */ };

			public: // public interface
				bool get (const std::string &, std::string &value) const;
				const std::string get (const std::string &name) const;
				bool is_set (const std::string &name) const;

			public: // deprecated public interface
				bool getValue (char name, std::string &value) const;
				const std::string getValue (char name) const;

				bool isSet (char name) const;
				bool allNames (std::list<char> &values) const;

		};
	}

#endif  /* __ARGUMENTS_H */

