source: branches/replacing_gnuplot/bin/Parameter.h @ 758

Last change on this file since 758 was 646, checked in by Jari Häkkinen, 13 years ago

Merged trunk changes r608:645 to replacing_gnuplot branch.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1#ifndef _theplu_svndigest_parameter_
2#define _theplu_svndigest_parameter_
3
4// $Id: Parameter.h 646 2008-06-03 22:05:22Z jari $
5
6/*
7  Copyright (C) 2006 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2007 Peter Johansson
9
10  This file is part of svndigest, http://trac.thep.lu.se/svndigest
11
12  svndigest is free software; you can redistribute it and/or modify it
13  under the terms of the GNU General Public License as published by
14  the Free Software Foundation; either version 2 of the License, or
15  (at your option) any later version.
16
17  svndigest is distributed in the hope that it will be useful, but
18  WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21
22  You should have received a copy of the GNU General Public License
23  along with this program; if not, write to the Free Software
24  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25  02111-1307, USA.
26*/
27
28#include "Option.h"
29
30#include <map>
31#include <string>
32
33namespace theplu {
34namespace svndigest {
35
36  // class for command line options.
37  class Parameter {
38  public:
39    Parameter( int argc, char *argv[]);
40    std::string config_file(void) const;
41    inline bool copyright(void) const { return copyright_.value(); }
42    /// @todo
43    inline bool force(void) const { return force_.value(); }
44    inline bool generate_config(void) const { return generate_config_.value(); }
45    // Until we fix caching (#313) ignore caching
46    //inline bool ignore_cache(void) const { return ignore_cache_.value(); }
47    inline bool ignore_cache(void) const { return true; }
48    inline bool report(void) const { return report_.value(); }
49    inline bool revisions(void) const { return revisions_.value(); }
50    /// @return absolute path to root directory
51    inline const std::string& root(void) const { return root_.value(); }
52    /// @return absolute path to root node
53    inline const std::string& root_node(void) const {return root_node_.value();}
54    /// @return absolute path to target directory
55    inline const std::string& targetdir(void) const 
56    { return targetdir_.value(); }
57    inline bool verbose(void) const { return verbose_.value(); }
58
59  private:
60    void analyse(void);
61    void help(void) const;
62    void missing_argument(std::string opt) const;
63    void version(bool=false) const;
64
65    Option<std::string> config_file_;
66    Option<bool> copyright_;
67    Option<bool> force_;
68    Option<bool> generate_config_;
69    Option<bool> ignore_cache_;
70    Option<bool> report_;
71    Option<bool> revisions_;
72    Option<std::string> root_;
73    Option<std::string> root_node_;
74    Option<std::string> targetdir_;
75    Option<bool> verbose_;
76  };
77
78}} // of namespace svndigest and namespace theplu
79
80#endif
Note: See TracBrowser for help on using the repository browser.