SourceForge Logo
Main Page   Compound List   File List   Compound Members   File Members  

CommandLineParser.h

Go to the documentation of this file.
00001 /*!
00002  * \file CommandLineParser.h 
00003  * \brief Defines the parser of the command line arguments
00004  *
00005  * \author Frederic RUAUDEL <grumz@users.sf.net>
00006  *
00007  * $Revision: 1.5 $
00008  * $Date: 2003/02/19 10:48:11 $
00009  *
00010  * \b TPassGuard
00011  * Copyleft (c) 2002 Frederic RUAUDEL, all rights reversed
00012  *
00013  * This program is free software which I release under the GNU General Public
00014  * License. You may redistribute and/or modify this program under the terms
00015  * of that license as published by the Free Software Foundation; either
00016  * version 2 of the License, or (at your option) any later version.
00017  *
00018  * This program is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.  Version 2 is in the
00022  * COPYING file in the top level directory of this distribution.
00023  *
00024  * To get a copy of the GNU General Public License, write to the Free Software
00025  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026  **/
00027 
00028 #ifndef COMMAND_LINE_PARSER_H
00029 #define COMMAND_LINE_PARSER_H
00030 
00031 #include <iostream>
00032 #include <string>
00033 #include <list>
00034 #include <map>
00035 
00036 #include <Passguard.h>
00037 
00038 using namespace std;
00039 
00040 /*!
00041  * \brief the parser of the command line arguments
00042  **/
00043 class CommandLineParser
00044 {
00045         public:
00046                 CommandLineParser (int argc, const char** argv);
00047                 ~CommandLineParser ();
00048 
00049                 void parse (void);
00050                 bool check_syntax (void);
00051                 void syntax_error (void);
00052 
00053                 string getOption (string option);
00054                 string getMode (void) const;
00055                 list<string> getSearchStringList (void) const;
00056                 void setSyntaxErrorString (string error_message);
00057         
00058         private:
00059                 list<string> _command_line_tokens;
00060                 string _program_name;
00061                 map<string,string> _options_list;
00062                 string _mode;
00063                 list<string> _search_string_list;
00064                 list<string> _unknown_options_list;
00065                 list<string> _bad_options_list;
00066                 list<string> _duplicate_options_list;
00067                 list<string> _bad_search_string_list;
00068                 list<string> _duplicate_modes_list;
00069                 list<string> _errors_list;
00070 };
00071 
00072 #endif /* COMMAND_LINE_PARSER_H */

Generated on Thu Feb 27 13:26:19 2003 for TPassGuard by doxygen1.2.15