source: trunk/bin/Parameter.h @ 1017

Last change on this file since 1017 was 1017, checked in by Peter Johansson, 12 years ago

updating copyright years

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.7 KB
RevLine 
[165]1#ifndef _theplu_svndigest_parameter_
2#define _theplu_svndigest_parameter_
3
[37]4// $Id: Parameter.h 1017 2010-01-09 14:41:34Z peter $
5
[84]6/*
[978]7  Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
[1017]8  Copyright (C) 2009, 2010 Peter Johansson
[84]9
[687]10  This file is part of svndigest, http://dev.thep.lu.se/svndigest
[84]11
[149]12  svndigest is free software; you can redistribute it and/or modify it
[84]13  under the terms of the GNU General Public License as published by
[693]14  the Free Software Foundation; either version 3 of the License, or
[84]15  (at your option) any later version.
16
[149]17  svndigest is distributed in the hope that it will be useful, but
[84]18  WITHOUT ANY WARRANTY; without even the implied warranty of
[149]19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[84]20  General Public License for more details.
21
22  You should have received a copy of the GNU General Public License
[693]23  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
[84]24*/
25
[820]26#include "OptionVersion.h"
27
[795]28#include "yat/CommandLine.h"
29#include "yat/OptionArg.h"
[820]30#include "yat/OptionHelp.h"
31#include "yat/OptionSwitch.h"
[625]32
[820]33
[37]34#include <string>
35
36namespace theplu {
[795]37namespace yat { 
38namespace utility {
39  class OptionHelp;
40  class OptionSwitch;
41}}
[149]42namespace svndigest {
[37]43
[705]44  class OptionVersion;
45
[37]46  // class for command line options.
47  class Parameter {
48  public:
[518]49    Parameter( int argc, char *argv[]);
[705]50    virtual ~Parameter(void);
[240]51    std::string config_file(void) const;
[705]52   
53    bool copyright(void) const;
54    bool force(void) const;
55    bool generate_config(void) const ;
56    bool ignore_cache(void) const;
[1015]57    const yat::utility::OptionArg<std::string>& format(void) const;
[705]58    bool report(void) const;
59    bool revisions(void) const;
[116]60    /// @return absolute path to root directory
[705]61    std::string root(void) const;
[116]62    /// @return absolute path to target directory
[705]63    std::string targetdir(void) const;
64    bool verbose(void) const;
[37]65
66  private:
67    void analyse(void);
[705]68    // throw cmd_error if path doesn't exist
69    void check_existence(std::string path) const;
70    // throw cmd_error if path is not dir
71    void check_is_dir(std::string path) const;
72    // throw cmd_error if path is not readable
73    void check_readable(std::string path) const;
[37]74
[705]75    void init(void);
76
[795]77    yat::utility::CommandLine cmd_;
[820]78    yat::utility::OptionArg<std::string> config_file_;
79    yat::utility::OptionSwitch copyright_;
80    yat::utility::OptionSwitch force_;
81    yat::utility::OptionSwitch generate_config_;
82    yat::utility::OptionHelp help_;
83    yat::utility::OptionSwitch ignore_cache_;
[1015]84    yat::utility::OptionArg<std::string> format_;
[820]85    yat::utility::OptionSwitch report_;
86    yat::utility::OptionSwitch revisions_;
87    yat::utility::OptionArg<std::string> root_;
88    yat::utility::OptionArg<std::string> target_;
89    yat::utility::OptionSwitch verbose_;
90    OptionVersion version_;
[705]91
[37]92  };
93
[149]94}} // of namespace svndigest and namespace theplu
[37]95
96#endif
Note: See TracBrowser for help on using the repository browser.