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.
Public Member Functions | Private Attributes | List of all members
SWGSDRangel::SWGPresetImport Class Reference

#include <SWGPresetImport.h>

+ Inheritance diagram for SWGSDRangel::SWGPresetImport:
+ Collaboration diagram for SWGSDRangel::SWGPresetImport:

Public Member Functions

 SWGPresetImport ()
 
 SWGPresetImport (QString *json)
 
virtual ~SWGPresetImport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGPresetImportfromJson (QString &jsonString) override
 
QString * getGroupName ()
 
void setGroupName (QString *group_name)
 
QString * getDescription ()
 
void setDescription (QString *description)
 
QString * getFilePath ()
 
void setFilePath (QString *file_path)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * group_name
 
bool m_group_name_isSet
 
QString * description
 
bool m_description_isSet
 
QString * file_path
 
bool m_file_path_isSet
 

Detailed Description

Definition at line 32 of file SWGPresetImport.h.

Constructor & Destructor Documentation

◆ SWGPresetImport() [1/2]

SWGSDRangel::SWGPresetImport::SWGPresetImport ( )

◆ SWGPresetImport() [2/2]

SWGSDRangel::SWGPresetImport::SWGPresetImport ( QString *  json)

Definition at line 25 of file SWGPresetImport.cpp.

References fromJson(), and init().

25  {
26  init();
27  this->fromJson(*json);
28 }
virtual SWGPresetImport * fromJson(QString &jsonString) override
+ Here is the call graph for this function:

◆ ~SWGPresetImport()

SWGSDRangel::SWGPresetImport::~SWGPresetImport ( )
virtual

Definition at line 39 of file SWGPresetImport.cpp.

References cleanup().

39  {
40  this->cleanup();
41 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGPresetImport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 86 of file SWGPresetImport.cpp.

References asJsonObject().

Referenced by SWGSDRangel::SWGInstanceApi::instancePresetFilePut().

87 {
88  QJsonObject* obj = this->asJsonObject();
89 
90  QJsonDocument doc(*obj);
91  QByteArray bytes = doc.toJson();
92  delete obj;
93  return QString(bytes);
94 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asJsonObject()

QJsonObject * SWGSDRangel::SWGPresetImport::asJsonObject ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 97 of file SWGPresetImport.cpp.

References description, file_path, group_name, and SWGSDRangel::toJsonValue().

Referenced by asJson().

97  {
98  QJsonObject* obj = new QJsonObject();
99  if(group_name != nullptr && *group_name != QString("")){
100  toJsonValue(QString("groupName"), group_name, obj, QString("QString"));
101  }
102  if(description != nullptr && *description != QString("")){
103  toJsonValue(QString("description"), description, obj, QString("QString"));
104  }
105  if(file_path != nullptr && *file_path != QString("")){
106  toJsonValue(QString("filePath"), file_path, obj, QString("QString"));
107  }
108 
109  return obj;
110 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGPresetImport::cleanup ( )

Definition at line 54 of file SWGPresetImport.cpp.

References description, file_path, and group_name.

Referenced by ~SWGPresetImport().

54  {
55  if(group_name != nullptr) {
56  delete group_name;
57  }
58  if(description != nullptr) {
59  delete description;
60  }
61  if(file_path != nullptr) {
62  delete file_path;
63  }
64 }
+ Here is the caller graph for this function:

◆ fromJson()

SWGPresetImport * SWGSDRangel::SWGPresetImport::fromJson ( QString &  jsonString)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 67 of file SWGPresetImport.cpp.

References fromJsonObject().

Referenced by WebAPIRequestMapper::instancePresetFileService(), and SWGPresetImport().

67  {
68  QByteArray array (json.toStdString().c_str());
69  QJsonDocument doc = QJsonDocument::fromJson(array);
70  QJsonObject jsonObject = doc.object();
71  this->fromJsonObject(jsonObject);
72  return this;
73 }
virtual void fromJsonObject(QJsonObject &json) override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

void SWGSDRangel::SWGPresetImport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 76 of file SWGPresetImport.cpp.

References description, file_path, group_name, and SWGSDRangel::setValue().

Referenced by fromJson().

76  {
77  ::SWGSDRangel::setValue(&group_name, pJson["groupName"], "QString", "QString");
78 
79  ::SWGSDRangel::setValue(&description, pJson["description"], "QString", "QString");
80 
81  ::SWGSDRangel::setValue(&file_path, pJson["filePath"], "QString", "QString");
82 
83 }
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDescription()

QString * SWGSDRangel::SWGPresetImport::getDescription ( )

Definition at line 123 of file SWGPresetImport.cpp.

References description.

Referenced by WebAPIAdapterSrv::instancePresetFilePut().

123  {
124  return description;
125 }
+ Here is the caller graph for this function:

◆ getFilePath()

QString * SWGSDRangel::SWGPresetImport::getFilePath ( )

Definition at line 133 of file SWGPresetImport.cpp.

References file_path.

Referenced by WebAPIAdapterSrv::instancePresetFilePut(), and WebAPIRequestMapper::instancePresetFileService().

133  {
134  return file_path;
135 }
+ Here is the caller graph for this function:

◆ getGroupName()

QString * SWGSDRangel::SWGPresetImport::getGroupName ( )

Definition at line 113 of file SWGPresetImport.cpp.

References group_name.

Referenced by WebAPIAdapterSrv::instancePresetFilePut().

113  {
114  return group_name;
115 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGPresetImport::init ( )

Definition at line 44 of file SWGPresetImport.cpp.

References description, file_path, group_name, m_description_isSet, m_file_path_isSet, and m_group_name_isSet.

Referenced by SWGPresetImport().

44  {
45  group_name = new QString("");
46  m_group_name_isSet = false;
47  description = new QString("");
48  m_description_isSet = false;
49  file_path = new QString("");
50  m_file_path_isSet = false;
51 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGPresetImport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 144 of file SWGPresetImport.cpp.

References description, file_path, and group_name.

144  {
145  bool isObjectUpdated = false;
146  do{
147  if(group_name != nullptr && *group_name != QString("")){ isObjectUpdated = true; break;}
148  if(description != nullptr && *description != QString("")){ isObjectUpdated = true; break;}
149  if(file_path != nullptr && *file_path != QString("")){ isObjectUpdated = true; break;}
150  }while(false);
151  return isObjectUpdated;
152 }

◆ setDescription()

void SWGSDRangel::SWGPresetImport::setDescription ( QString *  description)

Definition at line 127 of file SWGPresetImport.cpp.

References description, and m_description_isSet.

127  {
128  this->description = description;
129  this->m_description_isSet = true;
130 }

◆ setFilePath()

void SWGSDRangel::SWGPresetImport::setFilePath ( QString *  file_path)

Definition at line 137 of file SWGPresetImport.cpp.

References file_path, and m_file_path_isSet.

137  {
138  this->file_path = file_path;
139  this->m_file_path_isSet = true;
140 }

◆ setGroupName()

void SWGSDRangel::SWGPresetImport::setGroupName ( QString *  group_name)

Definition at line 117 of file SWGPresetImport.cpp.

References group_name, and m_group_name_isSet.

117  {
118  this->group_name = group_name;
119  this->m_group_name_isSet = true;
120 }

Member Data Documentation

◆ description

QString* SWGSDRangel::SWGPresetImport::description
private

◆ file_path

QString* SWGSDRangel::SWGPresetImport::file_path
private

◆ group_name

QString* SWGSDRangel::SWGPresetImport::group_name
private

◆ m_description_isSet

bool SWGSDRangel::SWGPresetImport::m_description_isSet
private

Definition at line 62 of file SWGPresetImport.h.

Referenced by init(), setDescription(), and SWGPresetImport().

◆ m_file_path_isSet

bool SWGSDRangel::SWGPresetImport::m_file_path_isSet
private

Definition at line 65 of file SWGPresetImport.h.

Referenced by init(), setFilePath(), and SWGPresetImport().

◆ m_group_name_isSet

bool SWGSDRangel::SWGPresetImport::m_group_name_isSet
private

Definition at line 59 of file SWGPresetImport.h.

Referenced by init(), setGroupName(), and SWGPresetImport().


The documentation for this class was generated from the following files: