From: Christian P. <cp...@us...> - 2005-01-24 22:59:35
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3902/include/pclasses/App Modified Files: BackgroundApp.h CmdLine.h Log Message: Move background forking into BackgroundApp::daemonize(). More CmdLine work. Index: BackgroundApp.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/App/BackgroundApp.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- BackgroundApp.h 18 Jan 2005 17:50:07 -0000 1.1 +++ BackgroundApp.h 24 Jan 2005 22:58:38 -0000 1.2 @@ -24,6 +24,7 @@ #include <pclasses/Export.h> #include <pclasses/System/SystemError.h> #include <pclasses/App/SimpleApp.h> +#include <pclasses/App/CmdLine.h> namespace P { @@ -36,11 +37,19 @@ ~BackgroundApp() throw(); protected: + void setCommandLineOpts(CmdLineOption* opts[]); + void showCommandLineHelp(); + + void daemonize(); + virtual void reload(); virtual int init(int argc, char* argv[]); virtual void cleanup(); virtual void finish(); virtual void signal(int sig); + + private: + CmdLineParser _cmdLineParser; }; } // !namespace App Index: CmdLine.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/App/CmdLine.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- CmdLine.h 21 Jan 2005 09:21:07 -0000 1.5 +++ CmdLine.h 24 Jan 2005 22:58:38 -0000 1.6 @@ -38,16 +38,22 @@ virtual ~CmdLineOption(); + //! Returns the short option-name const std::string& shortName() const throw(); + //! Returns the long option-name const std::string& longName() const throw(); + //! Returns the help-text const std::string& helpText() const throw(); + //! Returns true if the option is required bool required() const throw(); + //! Returns true if the option was found bool isset() const throw(); + //! Returns true if the option needs a value bool needValue() const throw(); virtual void setValue(const std::string& val) = 0; @@ -107,6 +113,8 @@ CmdLineParser(CmdLineOption* opts[] = 0); ~CmdLineParser(); + void setOptions(CmdLineOption* opts[]); + void parse(int argc, char* argv[]) throw(CmdLineError); void parse(const std::string& cmdline) throw(CmdLineError); |