Patronum
feature.cpp
Go to the documentation of this file.
1 #include "feature.h"
2 
3 #include <QDataStream>
4 
5 namespace Patronum {
6 
7 Feature::Feature(const QString &cmd, const QVariant &arg,
8  const QString &description, const QString &example) {
9  _cmd = cmd;
10  _arg = arg;
11  _description = description;
12  _example = example;
13 }
14 
15 QString Feature::cmd() const {
16  return _cmd;
17 }
18 
19 void Feature::setCmd(const QString &cmd) {
20  _cmd = cmd;
21 }
22 
23 QVariant Feature::arg() const {
24  return _arg;
25 }
26 
27 void Feature::setArg(const QVariantList &arg) {
28  _arg = arg;
29 }
30 
31 QString Feature::description() const {
32  return _description;
33 }
34 
35 void Feature::setDescription(const QString &description) {
36  _description = description;
37 }
38 
39 QString Feature::example() const {
40  return _example;
41 }
42 
43 void Feature::setExample(const QString &example) {
44  _example = example;
45 }
46 
47 QDataStream &operator<<(QDataStream &stream, const Feature &obj) {
48  stream << obj._cmd << obj._arg;
49 
50  return stream;
51 }
52 
53 QDataStream &operator>>(QDataStream &stream, Feature &obj) {
54  stream >> obj._cmd >> obj._arg;
55  return stream;
56 }
57 
58 }
void setExample(const QString &example)
Definition: feature.cpp:43
QString cmd() const
Definition: feature.cpp:15
void setArg(const QVariantList &arg)
Definition: feature.cpp:27
QString description() const
Definition: feature.cpp:31
void setDescription(const QString &description)
Definition: feature.cpp:35
friend QDataStream & operator<<(QDataStream &stream, const Feature &obj)
Definition: feature.cpp:47
friend QDataStream & operator>>(QDataStream &stream, Feature &obj)
Definition: feature.cpp:53
QString example() const
Definition: feature.cpp:39
void setCmd(const QString &cmd)
Definition: feature.cpp:19
QVariant arg() const
Definition: feature.cpp:23
The Feature class - it is atomic type for describe service command.
Definition: feature.h:15