00001 // $Id: ProgramOptions.hh 1756 2011-01-06 10:10:07Z tho $ 00002 // 00003 // Copyright (C) 2008 00004 // Fraunhofer (FOKUS) 00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY 00006 // Stefan Bund <g0dil@berlios.de> 00007 // 00008 // This program is free software; you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation; either version 2 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with this program; if not, write to the 00020 // Free Software Foundation, Inc., 00021 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00022 00026 #ifndef HH_SENF_Scheduler_Console_ProgramOptions_ 00027 #define HH_SENF_Scheduler_Console_ProgramOptions_ 1 00028 00029 // Custom includes 00030 #include "Config.hh" 00031 00032 00033 //#include "ProgramOptions.mpp" 00034 #include "ProgramOptions.ih" 00035 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00036 00037 namespace senf { 00038 namespace console { 00039 00067 class ProgramOptions 00068 : public detail::BundleMixin 00069 { 00070 public: 00071 //-//////////////////////////////////////////////////////////////////////// 00073 //\{ 00074 00075 ProgramOptions(int argc, char const ** argv, DirectoryNode & root = root()); 00077 00081 //\} 00082 //-//////////////////////////////////////////////////////////////////////// 00083 00084 template <class Container> 00085 ProgramOptions & nonOptions(Container & container); 00087 00091 ProgramOptions & alias(char letter, std::string const & longOpt, bool withArg=false); 00093 00105 private: 00106 detail::ProgramOptionsSource & config_; 00107 }; 00108 00116 void parseOptions(int argc, char const ** argv, DirectoryNode & root = root()); 00117 00125 detail::ProgramOptionsSource::ptr OptionsConfig(int argc, char const ** argv); 00126 }} 00127 00128 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00129 #include "ProgramOptions.cci" 00130 //#include "ProgramOptions.ct" 00131 #include "ProgramOptions.cti" 00132 #endif 00133 00134 00135 // Local Variables: 00136 // mode: c++ 00137 // fill-column: 100 00138 // comment-column: 40 00139 // c-file-style: "senf" 00140 // indent-tabs-mode: nil 00141 // ispell-local-dictionary: "american" 00142 // compile-command: "scons -u test" 00143 // End: