1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-28 07:46:37 -04:00

Web API: added missing files

This commit is contained in:
f4exb 2017-11-25 05:28:43 +01:00
parent 68fbbcf768
commit 036432ae58
2 changed files with 150 additions and 0 deletions

View File

@ -0,0 +1,95 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
#include "SWGDVSerialDevice.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace Swagger {
SWGDVSerialDevice::SWGDVSerialDevice(QString* json) {
init();
this->fromJson(*json);
}
SWGDVSerialDevice::SWGDVSerialDevice() {
init();
}
SWGDVSerialDevice::~SWGDVSerialDevice() {
this->cleanup();
}
void
SWGDVSerialDevice::init() {
device_name = new QString("");
}
void
SWGDVSerialDevice::cleanup() {
if(device_name != nullptr) {
delete device_name;
}
}
SWGDVSerialDevice*
SWGDVSerialDevice::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGDVSerialDevice::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&device_name, pJson["deviceName"], "QString", "QString");
}
QString
SWGDVSerialDevice::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject*
SWGDVSerialDevice::asJsonObject() {
QJsonObject* obj = new QJsonObject();
toJsonValue(QString("deviceName"), device_name, obj, QString("QString"));
return obj;
}
QString*
SWGDVSerialDevice::getDeviceName() {
return device_name;
}
void
SWGDVSerialDevice::setDeviceName(QString* device_name) {
this->device_name = device_name;
}
}

View File

@ -0,0 +1,55 @@
/**
* SDRangel
* This is the web API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube
*
* OpenAPI spec version: 4.0.0
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/*
* SWGDVSerialDevice.h
*
* DV serial device details
*/
#ifndef SWGDVSerialDevice_H_
#define SWGDVSerialDevice_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
namespace Swagger {
class SWGDVSerialDevice: public SWGObject {
public:
SWGDVSerialDevice();
SWGDVSerialDevice(QString* json);
virtual ~SWGDVSerialDevice();
void init();
void cleanup();
QString asJson ();
QJsonObject* asJsonObject();
void fromJsonObject(QJsonObject &json);
SWGDVSerialDevice* fromJson(QString &jsonString);
QString* getDeviceName();
void setDeviceName(QString* device_name);
private:
QString* device_name;
};
}
#endif /* SWGDVSerialDevice_H_ */