-
Notifications
You must be signed in to change notification settings - Fork 0
/
clioption.h
71 lines (56 loc) · 1.87 KB
/
clioption.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*!
* \file
* C++ interface for the \c CliOption class.
*
* \author Stephen Bryant <steve@bawue.de>
* \date $Date: 2010-09-24 00:22:44 +0200 (Fri, 24 Sep 2010) $
*/
#ifndef CliOption_H
#define CliOption_H
#include <QString>
#include <QStringList>
#include <QSet>
/*!
* \class CliOption clioption.h
* \brief An option on the command line interface.
* \author Stephen Bryant <steve@bawue.de>
*
* This class is used to describe an option on the command line. It allows
* for different ways of defining the same option - long and short, with
* multiple aliases possible. It is also used to describe how the option
* is used - it may be an on/off switch or take an argument etc.
*
* \sa CliParser
*/
class CliOption
{
public:
//! Default constructor.
CliOption();
//! Constructor with initialisation.
CliOption( const QStringList & names, const bool bHasArg = false );
//! Set with the named of long options.
QSet< QString > m_longnameSet;
//! Set with the named of short options.
QSet< QChar > m_shortnameSet;
//! Whether the option takes an argument.
bool m_bHasArg;
/*!
* Set the names to use for this option.
*
* Every option must have at least one name; it can be either short or
* long. The names specified must not start with the dash character.
*
* Any name in the list that is one character in length is a short
* name. Those which are 2 characters or longer are long names. Zero
* length and duplicate names are ignored. An option name may not start
* with a dash character (these are also ignored).
*
* The names are added to either \c m_longnameSet or \c m_shortnameSet.
* Existing entries in those sets are not removed.
*
* \param names a list of names to use for this option.
*/
void setNames( const QStringList & names );
};
#endif // CliOption_H