Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtCore/qcommandlineoption.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (C) 2020 The Qt Company Ltd.
0002 // Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
0003 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0004 
0005 #ifndef QCOMMANDLINEOPTION_H
0006 #define QCOMMANDLINEOPTION_H
0007 
0008 #include <QtCore/qstringlist.h>
0009 #include <QtCore/qshareddata.h>
0010 
0011 QT_REQUIRE_CONFIG(commandlineparser);
0012 
0013 QT_BEGIN_NAMESPACE
0014 
0015 class QCommandLineOptionPrivate;
0016 
0017 class Q_CORE_EXPORT QCommandLineOption
0018 {
0019 public:
0020     enum Flag {
0021         HiddenFromHelp = 0x1,
0022         ShortOptionStyle = 0x2
0023     };
0024     Q_DECLARE_FLAGS(Flags, Flag)
0025 
0026     explicit QCommandLineOption(const QString &name);
0027     explicit QCommandLineOption(const QStringList &names);
0028     /*implicit*/ QCommandLineOption(const QString &name, const QString &description,
0029                                 const QString &valueName = QString(),
0030                                 const QString &defaultValue = QString());
0031     /*implicit*/ QCommandLineOption(const QStringList &names, const QString &description,
0032                                 const QString &valueName = QString(),
0033                                 const QString &defaultValue = QString());
0034     QCommandLineOption(const QCommandLineOption &other);
0035 
0036     ~QCommandLineOption();
0037 
0038     QCommandLineOption &operator=(const QCommandLineOption &other);
0039     QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QCommandLineOption)
0040 
0041     void swap(QCommandLineOption &other) noexcept
0042     { d.swap(other.d); }
0043 
0044     QStringList names() const;
0045 
0046     void setValueName(const QString &name);
0047     QString valueName() const;
0048 
0049     void setDescription(const QString &description);
0050     QString description() const;
0051 
0052     void setDefaultValue(const QString &defaultValue);
0053     void setDefaultValues(const QStringList &defaultValues);
0054     QStringList defaultValues() const;
0055 
0056     Flags flags() const;
0057     void setFlags(Flags aflags);
0058 
0059 private:
0060     QSharedDataPointer<QCommandLineOptionPrivate> d;
0061 };
0062 
0063 Q_DECLARE_SHARED(QCommandLineOption)
0064 Q_DECLARE_OPERATORS_FOR_FLAGS(QCommandLineOption::Flags)
0065 
0066 
0067 QT_END_NAMESPACE
0068 
0069 #endif // QCOMMANDLINEOPTION_H