Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

commandline.h

Go to the documentation of this file.
00001 /* commandline.h    $Revision: 1.2 $ $Date: 2005/12/10 20:33:54 $
00002    Copyright (C) 1998 University of Bonn.
00003    http://www.ikp.uni-bonn.de/boss
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public License
00007    as published by the Free Software Foundation; either version 2
00008    of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA  02111-1307, USA.
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

Generated on Tue Dec 20 23:14:38 2005 for BOSS by doxygen 1.3.6