yat  0.21pre
OptionVersion.h
1 #ifndef _theplu_yat_utility_option_version_
2 #define _theplu_yat_utility_option_version_
3 
4 // $Id: OptionVersion.h 4183 2022-06-30 05:54:43Z peter $
5 
6 /*
7  Copyright (C) 2022 Peter Johansson
8 
9  This file is part of the yat library, http://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #include "OptionSwitch.h"
26 
27 #include <string>
28 #include <vector>
29 
30 namespace theplu {
31 namespace yat {
32 namespace utility {
33 
34  class CommandLine;
51  class OptionVersion : public OptionSwitch
52  {
53  public:
70  const std::string& prog,
71  const std::string& version,
72  const std::string& copyright_year,
73  const std::vector<std::string>& authors,
74  const std::string& package="",
75  const std::string& name="v,version",
76  const std::string& desc="output version information and exit");
77 
88  std::string& copyright_holder(void);
89 
98  std::string& license(void);
99  private:
100  void do_parse2(std::vector<std::string>::iterator first,
101  std::vector<std::string>::iterator last);
102  std::string prog_;
103  std::string version_;
104  std::string copyright_year_;
105  std::vector<std::string> authors_;
106  std::string package_;
107  std::string copyright_holder_;
108  std::string license_;
109  void print(std::ostream& os, const std::vector<std::string>&,
110  size_t offset) const;
111  void print(std::ostream& os, const std::string&, size_t& offset) const;
112  };
113 
114 }}} // of namespace utility, yat, and theplu
115 
116 #endif
The Department of Theoretical Physics namespace as we define it.
Class for switch option.
Definition: OptionSwitch.h:38
OptionVersion(CommandLine &cmd, const std::string &prog, const std::string &version, const std::string &copyright_year, const std::vector< std::string > &authors, const std::string &package="", const std::string &name="v,version", const std::string &desc="output version information and exit")
Constructor.
Class for parsing the command line.
Definition: CommandLine.h:98
std::string & copyright_holder(void)
Class for version option.
Definition: OptionVersion.h:51
std::string print(void)
print help output
std::string version(void)
const CommandLine & cmd(void) const

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14