From: stephan b. <sg...@us...> - 2004-12-30 16:38:54
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22607/include/pclasses/Util Added Files: SimpleArgvParser.h Log Message: egg. Doesn't yet do equals-sign parsing, but basically works. --- NEW FILE: SimpleArgvParser.h --- #ifndef P_Util_SIMPLEARGVPARSER_HPP_INCLUDED #define P_Util_SIMPLEARGVPARSER_HPP_INCLUDED 1 #include <pclasses/Util/SimplePropertyStore.h> #include <pclasses/Phoenix.h> namespace P { namespace Util { class SimpleArgvParser : public SimplePropertyStore { public: typedef ::P::Util::SimplePropertyStore ParentType; typedef ParentType::key_type key_type; typedef ParentType::mapped_type mapped_type; typedef ParentType::iterator iterator; typedef ParentType::const_iterator const_iterator; SimpleArgvParser( int argc, char ** argv ); virtual ~SimpleArgvParser(); size_t parse( int argc, char ** argv ); static SimpleArgvParser & args( int argc, char ** argv ); static SimpleArgvParser & args(); int argc() const { return this->size(); } private: SimpleArgvParser(); typedef ::P::Phoenix< SimpleArgvParser > ArgvPhoenix; friend class ArgvPhoenix; }; } } // namespace P:: Util #endif // P_Util_SIMPLEARGVPARSER_HPP_INCLUDED |