SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
SWGSuccessResponse.cpp
Go to the documentation of this file.
1 
14 #include "SWGSuccessResponse.h"
15 
16 #include "SWGHelpers.h"
17 
18 #include <QJsonDocument>
19 #include <QJsonArray>
20 #include <QObject>
21 #include <QDebug>
22 
23 namespace SWGSDRangel {
24 
26  init();
27  this->fromJson(*json);
28 }
29 
31  message = nullptr;
32  m_message_isSet = false;
33 }
34 
36  this->cleanup();
37 }
38 
39 void
41  message = new QString("");
42  m_message_isSet = false;
43 }
44 
45 void
47  if(message != nullptr) {
48  delete message;
49  }
50 }
51 
54  QByteArray array (json.toStdString().c_str());
55  QJsonDocument doc = QJsonDocument::fromJson(array);
56  QJsonObject jsonObject = doc.object();
57  this->fromJsonObject(jsonObject);
58  return this;
59 }
60 
61 void
63  ::SWGSDRangel::setValue(&message, pJson["message"], "QString", "QString");
64 
65 }
66 
67 QString
69 {
70  QJsonObject* obj = this->asJsonObject();
71 
72  QJsonDocument doc(*obj);
73  QByteArray bytes = doc.toJson();
74  delete obj;
75  return QString(bytes);
76 }
77 
78 QJsonObject*
80  QJsonObject* obj = new QJsonObject();
81  if(message != nullptr && *message != QString("")){
82  toJsonValue(QString("message"), message, obj, QString("QString"));
83  }
84 
85  return obj;
86 }
87 
88 QString*
90  return message;
91 }
92 void
94  this->message = message;
95  this->m_message_isSet = true;
96 }
97 
98 
99 bool
101  bool isObjectUpdated = false;
102  do{
103  if(message != nullptr && *message != QString("")){ isObjectUpdated = true; break;}
104  }while(false);
105  return isObjectUpdated;
106 }
107 }
108 
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
virtual QJsonObject * asJsonObject() override
virtual SWGSuccessResponse * fromJson(QString &jsonString) override
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
virtual QString asJson() override
virtual void fromJsonObject(QJsonObject &json) override