Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Application.H

00001 /* $Id: Application.H,v 1.2 2000/11/03 22:03:28 rpav Exp $
00002  *
00003  * SFW - Studio FrameWork
00004  * Copyright (C) 2000  Ryan Pavlik
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019  *
00020  */
00021 
00022 #ifndef APPLICATION_H
00023 #define APPLICATION_H
00024 
00025 #include <list>
00026 #include <map>
00027 #include <string>
00028 #include <getopt.h>
00029 #include <SFW/Object.H>
00030 
00031 namespace SFW {
00032     typedef list<string>       ArgList;
00033     typedef map<string,string> ArgMap;
00034 
00035     class Application : public Object {
00036     option *argSpecLong;
00037     char   *argSpecShort;
00038 
00039     int argLongNum, argLongCap, argShortCap;
00040 
00041     friend  bool SFW::parseArgs(Application *app,
00042                     int argc, char *argv[],
00043                     ArgMap &_argm, ArgList &_argl);
00044     protected:
00045     void addOpt(char name, int argType);
00046     void addLongOpt(const string &name, int argType);
00047     
00048     public:
00049     V_TYPE_INFO(SFW::Application, SFW::Object);
00050 
00051     Application();
00052     
00053     virtual int  main (ArgMap&, ArgList&) = 0;
00054     virtual void usage()                  = 0;
00055     };
00056 }
00057 
00058 #endif /* APPLICATION_H */

Generated at Tue Jan 2 15:38:33 2001 for SFW by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000