]>
Commit | Line | Data |
---|---|---|
7419f059 RC |
1 | /* |
2 | * Copyright (c) 2002 Robert Collins. | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * A copy of the GNU General Public License can be found at | |
10 | * http://www.gnu.org/ | |
11 | * | |
12 | * Written by Robert Collins <robertc@hotmail.com> | |
13 | * | |
14 | */ | |
15 | ||
16 | #ifndef _OPTIONSET_H_ | |
17 | #define _OPTIONSET_H_ | |
18 | ||
19 | #include <getopt.h> | |
1ae8e28d RC |
20 | #include <iosfwd> |
21 | ||
7419f059 RC |
22 | class Option; |
23 | ||
24 | class OptionSet | |
25 | { | |
26 | public: | |
27 | OptionSet(); | |
290fdf73 | 28 | virtual ~OptionSet(); |
1ae8e28d RC |
29 | virtual void Register (Option *); |
30 | virtual bool Process (int argc, char **argv, OptionSet *defaultOptionSet=0); | |
31 | virtual void ParameterUsage (ostream &); | |
7419f059 RC |
32 | protected: |
33 | OptionSet (OptionSet const &); | |
34 | OptionSet &operator= (OptionSet const &); | |
35 | // force initialisation of variables | |
36 | void Init (); | |
37 | private: | |
38 | Option **options; | |
39 | int optCount; | |
40 | }; | |
41 | ||
42 | #endif // _OPTIONSET_H_ |