API Documentation
Loading...
Searching...
No Matches
QTNetworkRequest.h
Go to the documentation of this file.
1#pragma once
2#include <NDEVR/NtpClient.h>
3#include <NDEVR/ItemDownloader.h>
4#include <NDEVR/String.h>
5#include <NDEVR/File.h>
6#include <NDEVR/Thread.h>
7#include <QNetworkRequest>
8#include <QNetworkAccessManager>
9#include <QNetworkReply>
10#include <QFile>
11namespace NDEVR
12{
13 static uint02 ntp_rx_port = 42912;
14 /**--------------------------------------------------------------------------------------------------
15 \brief Contains information specific for making a network request within the Qt Framework.
16 **/
18 {
19 Q_OBJECT
20 public:
21 QtNetworkRequest(const QNetworkRequest& request, QNetworkAccessManager* manager);
23 void setData(const File& data);
24 virtual void close() override;
25 virtual void abort() override;
26 void setReply(QNetworkReply* reply);
27 virtual bool isRunning() override;
28 virtual QByteArray data() override;
29 virtual bool start() override;
30 QNetworkRequest m_request;
31 QNetworkReply* m_reply = nullptr;
32 QNetworkAccessManager* m_manager;
35 };
36 /**--------------------------------------------------------------------------------------------------
37 \brief Allows the application to request network data using the Qt Framework.
38 **/
40 {
41 public:
42 static QNetworkRequest ConvertToRequest(const WebTarget& target);
43 virtual NetworkRequest* downloadFromURL(const WebTarget& url) override;
44 virtual NetworkRequest* uploadToURL(const WebTarget& request, const Buffer<uint01>& data) override;
45 NetworkRequest* uploadToURL(const WebTarget& request, const File& data) override;
46 virtual TimeRequest* networkTimeFromURL(const String& url, uint02 port) override;
47 protected:
48 QNetworkAccessManager* m_manager = nullptr;
49 };
50}
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
Provides an interface for accessing resources on the internet.
Definition ItemDownloader.h:109
A request for data or information from a network.
Definition ItemDownloader.h:51
Allows the application to request network data using the Qt Framework.
Definition QTNetworkRequest.h:40
NetworkRequest * uploadToURL(const WebTarget &request, const File &data) override
virtual TimeRequest * networkTimeFromURL(const String &url, uint02 port) override
QNetworkAccessManager * m_manager
Definition QTNetworkRequest.h:48
virtual NetworkRequest * downloadFromURL(const WebTarget &url) override
virtual NetworkRequest * uploadToURL(const WebTarget &request, const Buffer< uint01 > &data) override
static QNetworkRequest ConvertToRequest(const WebTarget &target)
Contains information specific for making a network request within the Qt Framework.
Definition QTNetworkRequest.h:18
QtNetworkRequest(const QNetworkRequest &request, QNetworkAccessManager *manager)
void setData(const File &data)
QNetworkAccessManager * m_manager
Definition QTNetworkRequest.h:32
virtual void close() override
void setReply(QNetworkReply *reply)
virtual bool isRunning() override
virtual QByteArray data() override
QNetworkRequest m_request
Definition QTNetworkRequest.h:30
Buffer< uint01 > m_data
Definition QTNetworkRequest.h:33
virtual void abort() override
QNetworkReply * m_reply
Definition QTNetworkRequest.h:31
File m_file
Definition QTNetworkRequest.h:34
void setData(const Buffer< uint01 > &data)
virtual bool start() override
The core String class for the NDEVR API.
Definition String.h:69
A request to get the time from the network.
Definition ItemDownloader.h:77
Definition ACIColor.h:37
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:88
A url target and optional username and password for a network request.
Definition ItemDownloader.h:99