]> cygwin.com Git - cygwin-apps/setup.git/blame - libgetopt++/include/getopt++/StringOption.h
Implement paired boolean options
[cygwin-apps/setup.git] / libgetopt++ / include / getopt++ / StringOption.h
CommitLineData
1ae8e28d
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 _STRINGOPTION_H_
17#define _STRINGOPTION_H_
18
19#include <getopt++/Option.h>
20#include <getopt++/GetOption.h>
21
22// Each registered option must implement this class.
23class StringOption : public Option
24{
25public:
e930272e
RC
26 StringOption(std::string const defaultvalue, char shortopt, char const *longopt = 0,
27 std::string const &shorthelp = std::string(), bool const optional = true,
1ae8e28d
RC
28 OptionSet &owner=GetOption::GetInstance());
29 virtual ~ StringOption ();
e930272e 30 virtual std::string const shortOption () const;
1d644c06 31 virtual std::string const longOption () const;
e930272e 32 virtual std::string const shortHelp () const;
8effde7a 33 virtual Result Process (char const *, int);
1d644c06 34 virtual Argument argument () const;
6af59184 35 operator const std::string& () const;
1ae8e28d
RC
36
37private:
1d644c06 38 Argument _optional;
e930272e 39 std::string _value;
1ae8e28d
RC
40 char _shortopt;
41 char const *_longopt;
e930272e 42 std::string _shorthelp;
1ae8e28d
RC
43};
44
45#endif // _STRINGOPTION_H_
This page took 0.088805 seconds and 5 git commands to generate.