paludis  Version 2.6.0
args_visitor.hh
Go to the documentation of this file.
1 /* vim: set sw=4 sts=4 et foldmethod=syntax : */
2 
3 /*
4  * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
5  * Copyright (c) 2006 Stephen Bennett
6  *
7  * This file is part of the Paludis package manager. Paludis is free software;
8  * you can redistribute it and/or modify it under the terms of the GNU General
9  * Public License version 2, as published by the Free Software Foundation.
10  *
11  * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
12  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18  * Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 #ifndef PALUDIS_GUARD_ARGS_ARGS_VISITOR_HH
22 #define PALUDIS_GUARD_ARGS_ARGS_VISITOR_HH 1
23 
24 #include <paludis/util/visitor.hh>
25 #include <paludis/util/wrapped_forward_iterator.hh>
27 #include <paludis/util/pimp.hh>
29 #include <string>
30 
31 /** \file
32  * Declarations for ArgsVisitor.
33  *
34  * \ingroup g_args
35  *
36  * \section Examples
37  *
38  * - None at this time.
39  */
40 
41 namespace paludis
42 {
43  namespace args
44  {
45  class ArgsOption;
46  class StringArg;
47  class AliasArg;
48  class SwitchArg;
49  class IntegerArg;
50  class EnumArg;
51  class StringSetArg;
52  class StringSequenceArg;
53 
54  /**
55  * Visitor class. Processes command-line options as they are found.
56  *
57  * \ingroup g_args
58  */
60  {
61  private:
62  Pimp<ArgsVisitor> _imp;
63 
64  const std::string & get_param(const ArgsOption &);
65 
66  std::string env_name(const std::string & long_name) const;
67 
68  public:
69  /**
70  * Constructor
71  *
72  * \since 0.49
73  */
77  const std::string &,
78  std::string & remaining_chars,
79  bool no,
80  ArgsOptionSpecifiedness specifiedness);
81 
82  ~ArgsVisitor();
83 
84  /// Visit a StringArg.
85  void visit(StringArg &);
86 
87  /// Visit an AliasArg.
88  void visit(AliasArg &);
89 
90  /// Visit a SwitchArg.
91  void visit(SwitchArg &);
92 
93  /// Visit an IntegerArg.
94  void visit(IntegerArg &);
95 
96  /// Visit an EnumArg.
97  void visit(EnumArg &);
98 
99  /// Visit a StringSetArg.
100  void visit(StringSetArg &);
101 
102  /// Visit a StringSequenceArg.
103  void visit(StringSequenceArg &);
104  };
105  }
106 }
107 
108 #endif
Definition: args_option.hh:436
Definition: args_visitor.hh:59
Definition: pimp.hh:51
Definition: about_metadata-fwd.hh:23
Definition: args_option.hh:544
Definition: args_option.hh:494
Definition: args_option.hh:204
Definition: args_option.hh:233
Definition: wrapped_forward_iterator-fwd.hh:26
Definition: args_option.hh:74
Definition: args_option.hh:389
#define PALUDIS_VISIBLE
Definition: attributes.hh:59
Definition: args_option.hh:280