00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __COMMANDLINEH__
00022 #define __COMMANDLINEH__
00023
00024 using namespace std;
00025
00026 #include <iostream>
00027 #include <vector>
00028 #include <map>
00029 #include <list>
00030 #include <algorithm>
00031 #include <string>
00032 #include "boss_utility/boss_optitem.h"
00033
00034 typedef vector< string > t_StringVector;
00035 typedef vector< BOSS::t_OptItem > t_OptItemVector;
00036 typedef list< string > t_StringList;
00037 typedef map< string, BOSS::t_OptItem, less< string > > t_OptItemMap;
00038
00039 namespace BOSS {
00052 class CommandLine
00053 {
00054
00055 private:
00056
00058 t_StringVector farg;
00059
00061 t_OptItemMap barg;
00062
00064 string usage;
00065
00066 void error(const string & s);
00067
00068 public:
00069
00070 CommandLine() { ; }
00071
00072 void print(ostream & s) const;
00073
00074 CommandLine(int argc, char ** argv, const t_OptItemVector & v,
00075 const string & s, const int fmin = -1, const int fmax = -1);
00076
00077 CommandLine & operator = (const CommandLine & C);
00078
00079 BOSS::t_OptItem operator () (const string & opt) const;
00080
00081 string operator [] (const unsigned i) const;
00082
00083 unsigned size() const { return farg.size(); }
00084 };
00085 }
00086
00087 #endif