LibEngsas
ecmdlineoption.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 - 2012 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  MA 02110-1301 USA.
18 */
19 
20 #ifndef ECMDLINEOPTION_H
21 #define ECMDLINEOPTION_H
22 
23 #include "eglobal.h"
24 
25 #include <QByteArray>
26 #include <QString>
27 
28 class KCmdLineOptions;
29 
38 {
39  public:
49  ECmdLineOption(const QByteArray &name,
50  const QByteArray &alias = QByteArray(),
51  const QString &description = QString(),
52  const QByteArray &defaultValue = QByteArray());
53 
62  void setName(const QByteArray &name);
63  QByteArray name() const;
72  bool requiresArgument() const;
81  bool isArgument() const;
87  bool isOptional() const;
94  void setAlias(const QByteArray &alias);
95  QByteArray alias() const;
99  void setDescription(const QString &description = QString());
100  QString description() const;
106  void setDefaultValue(const QByteArray &defaultValue = QByteArray());
107  QByteArray defaultValue() const;
108  void setIsSet(bool status = true);
112  bool isSet() const;
113  void setValue(const QByteArray &value);
119  QByteArray value() const;
123  QString usage() const;
127  QString helpLine() const;
133  void addToKCmdLineOptions(KCmdLineOptions *option) const;
134 
135  private:
136  QByteArray myName, myAlias;
137  QByteArray myDefaultValue, myValue;
138  QString myDescription;
139  bool myIsSet, myRequiresArgument;
140  bool myIsArgument, myIsOptional;
141 };
142 
143 #endif // ECMDLINEOPTION_H
bool myIsOptional
Definition: ecmdlineoption.h:140
bool myRequiresArgument
Definition: ecmdlineoption.h:139
#define E_CORE_EXPORT
Definition: eglobal.h:107
QString myDescription
Definition: ecmdlineoption.h:138
Represents one command line argument or option.
Definition: ecmdlineoption.h:37
QByteArray myValue
Definition: ecmdlineoption.h:137
QByteArray myName
Definition: ecmdlineoption.h:136