]> cygwin.com Git - cygwin-apps/setup.git/blame - libgetopt++/include/getopt++/OptionSet.h
Added dpiAwareness element to manifest
[cygwin-apps/setup.git] / libgetopt++ / include / getopt++ / OptionSet.h
CommitLineData
7419f059
RC
1/*
2 * Copyright (c) 2002 Robert Collins.
20e315e1 3 * Copyright (c) 2003 Robert Collins.
7419f059
RC
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * A copy of the GNU General Public License can be found at
11 * http://www.gnu.org/
12 *
13 * Written by Robert Collins <robertc@hotmail.com>
14 *
15 */
16
17#ifndef _OPTIONSET_H_
18#define _OPTIONSET_H_
19
1ae8e28d 20#include <iosfwd>
6f1abe45 21#include <vector>
1d644c06 22#include "getopt++/Option.h"
7419f059 23
20f237b4
JT
24typedef const std::string (*StrLookup)(unsigned int);
25
7419f059
RC
26class OptionSet
27{
28public:
29 OptionSet();
290fdf73 30 virtual ~OptionSet();
1ae8e28d 31 virtual void Register (Option *);
1d644c06
RC
32 virtual bool Process (int argc, char **argv, Option *nonOptionHandler);
33 virtual bool Process (std::vector<std::string> const &parms, Option *nonOptionHandler);
34 virtual bool process (Option *nonOptionHandler);
20f237b4 35 virtual void ParameterUsage (std::ostream &, StrLookup strLookup);
6f1abe45 36 virtual std::vector<Option *> const &optionsInSet() const;
1d644c06
RC
37 virtual std::vector<std::string> const &nonOptions() const;
38 virtual std::vector<std::string> const &remainingArgv() const;
7419f059
RC
39protected:
40 OptionSet (OptionSet const &);
41 OptionSet &operator= (OptionSet const &);
42 // force initialisation of variables
43 void Init ();
44private:
1d644c06
RC
45 void processOne();
46 bool isOption(std::string::size_type) const;
47 void doOption(std::string &option, std::string::size_type const &pos);
48 bool doNoArgumentOption(std::string &option, std::string::size_type const &pos);
8effde7a
JT
49 void findOption(std::string &option, std::string::size_type const &pos,
50 Option *&theOption, int & prefixIndex) const;
20e315e1 51 std::vector<Option *> options;
1d644c06
RC
52 std::vector<std::string> argv;
53 std::vector<std::string> nonoptions;
54 std::vector<std::string> remainingargv;
55 Option *nonOptionHandler;
56 Option::Result lastResult;
7419f059
RC
57};
58
59#endif // _OPTIONSET_H_
This page took 0.150596 seconds and 6 git commands to generate.