source: trunk/bin/Parameter.h @ 226

Last change on this file since 226 was 226, checked in by Peter Johansson, 15 years ago

added reading of config file in Parameter closes ##106 and #98. Move function check_target from svndigest.cc to utility.cc and changed name to node_exist. added support for aliases in Copyright update refs #36

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1#ifndef _theplu_svndigest_parameter_
2#define _theplu_svndigest_parameter_
3
4// $Id: Parameter.h 226 2007-03-11 19:32:41Z peter $
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://lev.thep.lu.se/trac/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 <map>
29#include <string>
30
31namespace theplu {
32namespace svndigest {
33
34  // class for command line options.
35  class Parameter {
36  public:
37    Parameter(const int argc,const char *argv[]);
38    inline bool copyright(void) const { return copyright_; }
39    /// @todo
40    inline const std::map<std::string, std::string>
41    copyright_alias(void) const { return copyright_alias_; }
42    inline bool force(void) const { return force_; }
43    inline bool revisions(void) const { return revisions_; }
44    /// @return absolute path to root directory
45    inline const std::string& root(void) const { return root_; }
46    /// @return absolute path to target directory
47    inline const std::string& targetdir(void) const { return targetdir_; }
48    inline bool verbose(void) const { return verbose_; }
49
50  private:
51    void analyse(void);
52    void defaults(void);
53    void help(void);
54    void print_config(std::string) const;
55    void read_config(std::string);
56    void version(void) const;
57
58    std::string config_path_;
59    bool copyright_;
60    std::map<std::string, std::string> copyright_alias_;
61    bool force_;
62    bool revisions_;
63    std::string root_;
64    std::string targetdir_;
65    bool verbose_;
66  };
67
68}} // of namespace svndigest and namespace theplu
69
70#endif
Note: See TracBrowser for help on using the repository browser.