00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef UTIL_CMDLINE_H
00025 #define UTIL_CMDLINE_H
00026
00027 #include <vector>
00028 #include <string>
00029 #include <iostream>
00030
00031
00032
00033 namespace util {
00034
00035 using std::string;
00036 using std::vector;
00037 using std::ostream;
00038
00039 typedef vector<string> VectS;
00040
00041
00048 class Cmdline : public VectS
00049 {
00050 public:
00051 Cmdline (int argc, const char** argv);
00052 explicit Cmdline (const string cmdline);
00053
00054 operator string () const;
00055 VectS& operator= (const VectS& source) { return VectS::operator= (source); }
00056
00057
00058 template <class In>
00059 Cmdline (In first, In last) : VectS (first,last) {}
00060 Cmdline () : VectS () {}
00061
00062 };
00063
00065 inline ostream& operator<< (ostream& os, const Cmdline& cmdL) { return os << (string (cmdL)); }
00066
00067
00068
00069 }
00070 #endif