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::SWGLoggingInfo Class Reference

#include <SWGLoggingInfo.h>

+ Inheritance diagram for SWGSDRangel::SWGLoggingInfo:
+ Collaboration diagram for SWGSDRangel::SWGLoggingInfo:

Public Member Functions

 SWGLoggingInfo ()
 
 SWGLoggingInfo (QString *json)
 
virtual ~SWGLoggingInfo ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGLoggingInfofromJson (QString &jsonString) override
 
QString * getConsoleLevel ()
 
void setConsoleLevel (QString *console_level)
 
QString * getFileLevel ()
 
void setFileLevel (QString *file_level)
 
qint32 getDumpToFile ()
 
void setDumpToFile (qint32 dump_to_file)
 
QString * getFileName ()
 
void setFileName (QString *file_name)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * console_level
 
bool m_console_level_isSet
 
QString * file_level
 
bool m_file_level_isSet
 
qint32 dump_to_file
 
bool m_dump_to_file_isSet
 
QString * file_name
 
bool m_file_name_isSet
 

Detailed Description

Definition at line 32 of file SWGLoggingInfo.h.

Constructor & Destructor Documentation

◆ SWGLoggingInfo() [1/2]

SWGSDRangel::SWGLoggingInfo::SWGLoggingInfo ( )

◆ SWGLoggingInfo() [2/2]

SWGSDRangel::SWGLoggingInfo::SWGLoggingInfo ( QString *  json)

Definition at line 25 of file SWGLoggingInfo.cpp.

References fromJson(), and init().

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

◆ ~SWGLoggingInfo()

SWGSDRangel::SWGLoggingInfo::~SWGLoggingInfo ( )
virtual

Definition at line 41 of file SWGLoggingInfo.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGLoggingInfo::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 93 of file SWGLoggingInfo.cpp.

References asJsonObject().

Referenced by SWGSDRangel::SWGInstanceApi::instanceLoggingPut(), and WebAPIRequestMapper::instanceLoggingService().

94 {
95  QJsonObject* obj = this->asJsonObject();
96 
97  QJsonDocument doc(*obj);
98  QByteArray bytes = doc.toJson();
99  delete obj;
100  return QString(bytes);
101 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 104 of file SWGLoggingInfo.cpp.

References console_level, dump_to_file, file_level, file_name, m_dump_to_file_isSet, and SWGSDRangel::toJsonValue().

Referenced by asJson().

104  {
105  QJsonObject* obj = new QJsonObject();
106  if(console_level != nullptr && *console_level != QString("")){
107  toJsonValue(QString("consoleLevel"), console_level, obj, QString("QString"));
108  }
109  if(file_level != nullptr && *file_level != QString("")){
110  toJsonValue(QString("fileLevel"), file_level, obj, QString("QString"));
111  }
113  obj->insert("dumpToFile", QJsonValue(dump_to_file));
114  }
115  if(file_name != nullptr && *file_name != QString("")){
116  toJsonValue(QString("fileName"), file_name, obj, QString("QString"));
117  }
118 
119  return obj;
120 }
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::SWGLoggingInfo::cleanup ( )

Definition at line 58 of file SWGLoggingInfo.cpp.

References console_level, file_level, and file_name.

Referenced by ~SWGLoggingInfo().

58  {
59  if(console_level != nullptr) {
60  delete console_level;
61  }
62  if(file_level != nullptr) {
63  delete file_level;
64  }
65 
66  if(file_name != nullptr) {
67  delete file_name;
68  }
69 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 72 of file SWGLoggingInfo.cpp.

References fromJsonObject().

Referenced by WebAPIRequestMapper::instanceLoggingService(), and SWGLoggingInfo().

72  {
73  QByteArray array (json.toStdString().c_str());
74  QJsonDocument doc = QJsonDocument::fromJson(array);
75  QJsonObject jsonObject = doc.object();
76  this->fromJsonObject(jsonObject);
77  return this;
78 }
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::SWGLoggingInfo::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 81 of file SWGLoggingInfo.cpp.

References console_level, dump_to_file, file_level, file_name, and SWGSDRangel::setValue().

Referenced by fromJson().

81  {
82  ::SWGSDRangel::setValue(&console_level, pJson["consoleLevel"], "QString", "QString");
83 
84  ::SWGSDRangel::setValue(&file_level, pJson["fileLevel"], "QString", "QString");
85 
86  ::SWGSDRangel::setValue(&dump_to_file, pJson["dumpToFile"], "qint32", "");
87 
88  ::SWGSDRangel::setValue(&file_name, pJson["fileName"], "QString", "QString");
89 
90 }
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:

◆ getConsoleLevel()

QString * SWGSDRangel::SWGLoggingInfo::getConsoleLevel ( )

◆ getDumpToFile()

qint32 SWGSDRangel::SWGLoggingInfo::getDumpToFile ( )

◆ getFileLevel()

QString * SWGSDRangel::SWGLoggingInfo::getFileLevel ( )

◆ getFileName()

QString * SWGSDRangel::SWGLoggingInfo::getFileName ( )

◆ init()

void SWGSDRangel::SWGLoggingInfo::init ( )

Definition at line 46 of file SWGLoggingInfo.cpp.

References console_level, dump_to_file, file_level, file_name, m_console_level_isSet, m_dump_to_file_isSet, m_file_level_isSet, and m_file_name_isSet.

Referenced by WebAPIAdapterGUI::instanceLoggingGet(), WebAPIAdapterSrv::instanceLoggingGet(), WebAPIAdapterSrv::instanceLoggingPut(), WebAPIAdapterGUI::instanceLoggingPut(), WebAPIAdapterSrv::instanceSummary(), WebAPIAdapterGUI::instanceSummary(), and SWGLoggingInfo().

46  {
47  console_level = new QString("");
48  m_console_level_isSet = false;
49  file_level = new QString("");
50  m_file_level_isSet = false;
51  dump_to_file = 0;
52  m_dump_to_file_isSet = false;
53  file_name = new QString("");
54  m_file_name_isSet = false;
55 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGLoggingInfo::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 164 of file SWGLoggingInfo.cpp.

References console_level, file_level, file_name, and m_dump_to_file_isSet.

Referenced by SWGSDRangel::SWGInstanceSummaryResponse::asJsonObject(), and SWGSDRangel::SWGInstanceSummaryResponse::isSet().

164  {
165  bool isObjectUpdated = false;
166  do{
167  if(console_level != nullptr && *console_level != QString("")){ isObjectUpdated = true; break;}
168  if(file_level != nullptr && *file_level != QString("")){ isObjectUpdated = true; break;}
169  if(m_dump_to_file_isSet){ isObjectUpdated = true; break;}
170  if(file_name != nullptr && *file_name != QString("")){ isObjectUpdated = true; break;}
171  }while(false);
172  return isObjectUpdated;
173 }
+ Here is the caller graph for this function:

◆ setConsoleLevel()

void SWGSDRangel::SWGLoggingInfo::setConsoleLevel ( QString *  console_level)

Definition at line 127 of file SWGLoggingInfo.cpp.

References console_level, and m_console_level_isSet.

127  {
129  this->m_console_level_isSet = true;
130 }

◆ setDumpToFile()

void SWGSDRangel::SWGLoggingInfo::setDumpToFile ( qint32  dump_to_file)

◆ setFileLevel()

void SWGSDRangel::SWGLoggingInfo::setFileLevel ( QString *  file_level)

Definition at line 137 of file SWGLoggingInfo.cpp.

References file_level, and m_file_level_isSet.

137  {
138  this->file_level = file_level;
139  this->m_file_level_isSet = true;
140 }

◆ setFileName()

void SWGSDRangel::SWGLoggingInfo::setFileName ( QString *  file_name)

Definition at line 157 of file SWGLoggingInfo.cpp.

References file_name, and m_file_name_isSet.

157  {
158  this->file_name = file_name;
159  this->m_file_name_isSet = true;
160 }

Member Data Documentation

◆ console_level

QString* SWGSDRangel::SWGLoggingInfo::console_level
private

◆ dump_to_file

qint32 SWGSDRangel::SWGLoggingInfo::dump_to_file
private

◆ file_level

QString* SWGSDRangel::SWGLoggingInfo::file_level
private

◆ file_name

QString* SWGSDRangel::SWGLoggingInfo::file_name
private

◆ m_console_level_isSet

bool SWGSDRangel::SWGLoggingInfo::m_console_level_isSet
private

Definition at line 62 of file SWGLoggingInfo.h.

Referenced by init(), setConsoleLevel(), and SWGLoggingInfo().

◆ m_dump_to_file_isSet

bool SWGSDRangel::SWGLoggingInfo::m_dump_to_file_isSet
private

Definition at line 68 of file SWGLoggingInfo.h.

Referenced by asJsonObject(), init(), isSet(), setDumpToFile(), and SWGLoggingInfo().

◆ m_file_level_isSet

bool SWGSDRangel::SWGLoggingInfo::m_file_level_isSet
private

Definition at line 65 of file SWGLoggingInfo.h.

Referenced by init(), setFileLevel(), and SWGLoggingInfo().

◆ m_file_name_isSet

bool SWGSDRangel::SWGLoggingInfo::m_file_name_isSet
private

Definition at line 71 of file SWGLoggingInfo.h.

Referenced by init(), setFileName(), and SWGLoggingInfo().


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