00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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
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