Lumiera  0.pre.03
»edit your freedom«
cmdline.hpp
Go to the documentation of this file.
1 /*
2  CMDLINE.hpp - abstraction of the usual commandline, a sequence of strings
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
34 #ifndef LIB_CMDLINE_H
35 #define LIB_CMDLINE_H
36 
37 #include <vector>
38 #include <string>
39 
40 
41 
42 namespace lib {
43 
44  using std::string;
45  using std::vector;
46  using std::ostream;
47 
48  typedef vector<string> VectS;
49 
50 
57  class Cmdline : public VectS
58  {
59  public:
60  Cmdline (int argc, const char** argv);
61  explicit Cmdline (const string cmdline);
62 
63  operator string () const;
64  VectS& operator= (const VectS& source) { return VectS::operator= (source); }
65 
66  // inherited ctors
67  template <class In>
68  Cmdline (In first, In last) : VectS (first,last) {}
69  Cmdline () : VectS () {}
70 
71  };
72 
73 
74 
75 } // namespace lib
76 #endif
Implementation namespace for support and library code.
Abstraction of the usual int argc, int** argv-Commandline, to be able to treat it as a vector of stri...
Definition: cmdline.hpp:57