-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathoptiondata.cpp
More file actions
90 lines (69 loc) · 2 KB
/
optiondata.cpp
File metadata and controls
90 lines (69 loc) · 2 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* Copyright (C) 2021-2026 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
#include "optiondata.h"
namespace QuasarAppUtils{
OptionData::OptionData(const QStringList& name,
const QString& arguments,
const QString& description,
const QString& example,
const QString& depricatedMsg,
bool removed) {
setNames(name);
setArguments(arguments);
setDescription(description);
setExample(example);
setDepricatedMsg(depricatedMsg);
_removed = removed;
}
const QStringList &OptionData::names() const {
return _name;
}
void OptionData::setNames(const QStringList &newName) {
_name = newName;
}
const QString &OptionData::description() const {
return _description;
}
void OptionData::setDescription(const QString &newDescription) {
_description = newDescription;
}
const QString &OptionData::example() const {
return _example;
}
void OptionData::setExample(const QString &newExample) {
_example = newExample;
}
const QString &OptionData::arguments() const {
return _arguments;
}
void OptionData::setArguments(const QString &newArguments) {
_arguments = newArguments;
}
const QString &OptionData::depricatedMsg() const {
return _depricatedMsg;
}
void OptionData::setDepricatedMsg(const QString &newDepricatedMsg) {
_depricatedMsg = newDepricatedMsg;
}
bool OptionData::isRemoved() const {
return _removed;
}
bool OptionData::isDepricated() const {
return depricatedMsg().size();
}
Help::Options OptionData::toHelp() const {
QString left = names().join(" / ") + " " + arguments();
QString right = description();
if (example().size()) {
right += " Example: " + example();
}
return {{left, {right}}};
}
bool OptionData::isValid() const {
return names().size();
}
}