QuasarAppLib 1.0.530.c9fba11
optiondata.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021-2026 QuasarApp.
3 * Distributed under the lgplv3 software license, see the accompanying
4 * Everyone is permitted to copy and distribute verbatim copies
5 * of this license document, but changing it is not allowed.
6*/
7
8
9#ifndef OPTIONDATA_H
10#define OPTIONDATA_H
11
12#include "quasarapp_global.h"
13#include "helpdata.h"
14
15namespace QuasarAppUtils{
16
21{
22public:
23
33 OptionData(const QStringList& names,
34 const QString& arguments = "",
35 const QString& description = "",
36 const QString& example = "",
37 const QString& deprecatedMsg = "",
38 bool removed = false);
39
44 const QStringList &names() const;
45
50 const QString &description() const;
51
56 const QString &example() const;
57
62 const QString &arguments() const;
63
69 const QString &deprecatedMsg() const;
70
79 Help::Options toHelp() const;
80
85 bool isValid() const;
86
91 bool isRemoved() const;
92
97 bool isDeprecated() const;
98
99protected:
105 void setNames(const QStringList &newNames);
106
113 void setDescription(const QString &newDescription);
114
121 void setExample(const QString &newExample);
122
129 void setArguments(const QString &newArguments);
130
136 void setDeprecatedMsg(const QString &newDeprecatedMsg);
137
138private:
139 QStringList _name;
140 QString _description;
141 QString _example;
142 QString _arguments;
143 QString _deprecatedMsg;
144 bool _removed;
145};
146
150typedef QMultiHash<QString, OptionData> OptionsDataList;
151}
152#endif // OPTIONDATA_H
bool isDeprecated() const
isDeprecated This method return true if this option is deprecated.
void setExample(const QString &newExample)
setExample This method sets a new example value of this option
const QString & example() const
example This is example of use string.
const QString & deprecatedMsg() const
deprecatedWarning This is a message that will be printed as a warning if user will use this option....
OptionData(const QStringList &names, const QString &arguments="", const QString &description="", const QString &example="", const QString &deprecatedMsg="", bool removed=false)
OptionData This is main constructor.
void setNames(const QStringList &newNames)
setNames This method sets new value of the option name.
void setDescription(const QString &newDescription)
setDescription This method sets new description of this options.
Help::Options toHelp() const
toHelp This method convert this option into help line. The help line have next structure :
bool isValid() const
isValid This method return true if the option is valid. If option do not contain a name then it is in...
void setArguments(const QString &newArguments)
setArguments This method sets new value of the options arguments
const QString & description() const
description This is description message of this option.
void setDeprecatedMsg(const QString &newDeprecatedMsg)
setDeprecatedMsg This method sets new value of the deprecated warning message of this option.
bool isRemoved() const
isRemoved This method return true if the option is removed.
const QString & arguments() const
arguments This is input arguments of this option or help message about arguments.
const QStringList & names() const
name This is name of the option. It is a required argument and cannot be empty.
QMultiMap< QString, QString > Options
Options this is list of key-descriptions pairs of help. The key is name of the available argument and...
Definition helpdata.h:32
The QuasarAppUtils namespace contains the base functions for all applications of the QuasarApp group....
QMultiHash< QString, OptionData > OptionsDataList
OptionsList is Hash map of the OptionData items. Where the key it is group name and value it is optio...
Definition optiondata.h:150
#define QUASARAPPSHARED_EXPORT