DuxReiNummariae 1.0.0-alpha.23
Simple and powerful budgeting application
 
Loading...
Searching...
No Matches
drn::networking Namespace Reference

Namespaces

namespace  testing
 

Classes

struct  FailureReply
 Contains details about a failed network request sent. More...
 
struct  HostError
 Represents an error with a network's URI hostname. More...
 
struct  NotifyingSender
 Derived objects provide an API for sending network requests and getting their replies as a notification signal. More...
 
class  QtReplyResponse
 Represents a network request's reply response using Qt's QNetworkReply. This is designed to encapsulate a QNetworkReply object, which is used for handling network responses in Qt applications. More...
 
class  QtRequestSender
 This is designed to send network requests with the help of Qt's QNetworkAccessManager. More...
 
struct  ReplyError
 Represents an error with a network reply. More...
 
class  ReplyNotifier
 Monitors and notifies the status of a network request. More...
 
class  ReplyResponse
 Interface for retrieving network replies from a sent request. When deriving, it'll provide methods for accessing various response information from a received network reply. More...
 
class  RequestBuilder
 A means to build a network request for sending. More...
 
class  RequestManager
 Manages all network requests and handles their responses. More...
 
class  RequestSender
 Interface for sending network requests. When deriving, it'll provide methods for sending various network requests. More...
 
struct  SuccessReply
 Contains details about a successfully sent network request. More...
 

Functions

DRN_NETWORKING_EXPORT::QDebug operator<< (::QDebug out, const HttpStatusCode code)
 Qt stream insertion operator.
 
DRN_NETWORKING_EXPORT::QDebug operator<< (::QDebug out, const RequestBuilder &rb)
 Stream insertion operator for a request builder into the debug buffer.
 
DRN_NETWORKING_EXPORT std::ostream & operator<< (std::ostream &out, const HttpStatusCode code)
 Stream insertion operator.
 
DRN_NETWORKING_EXPORT std::ostream & operator<< (std::ostream &out, const RequestBuilder &rb)
 Stream insertion operator for a request builder into the output buffer.
 
DRN_NETWORKING_EXPORT pecunia::Expected< SuccessReply, FailureReplyreceiveResponse (NotifyingSender &sender, const RequestBuilder &request) noexcept
 Sends a network request and returns the response synchronously. It blocks the calling thread until a response is received, or an error occurs.
 
DRN_NETWORKING_EXPORT HttpStatusCode toHttpStatusCode (const std::int32_t value)
 Converts an integer value to its corresponding HTTP status code.
 
DRN_NETWORKING_EXPORT std::int32_t toInteger (const HttpStatusCode value)
 Converts an HttpStatusCode to its integer representation.
 
DRN_NETWORKING_EXPORT std::string toStdString (const HttpStatusCode value)
 Converts an HttpStatusCode to its human-readable representation.
 

Variables

constexpr const std::array allStatusCodes
 Every known HTTP status code.
 

Function Documentation

◆ operator<<() [1/4]

DRN_NETWORKING_EXPORT::QDebug drn::networking::operator<< ( ::QDebug out,
const HttpStatusCode code )

Qt stream insertion operator.

Parameters
outThe stream to insert the HTTP status code information.
codeThe HTTP status code information to insert into the stream.
Postcondition
The stream contains the HTTP status code information in the form:
  • code [Description]
Returns
The modified stream.

◆ operator<<() [2/4]

DRN_NETWORKING_EXPORT::QDebug drn::networking::operator<< ( ::QDebug out,
const RequestBuilder & rb )

Stream insertion operator for a request builder into the debug buffer.

Parameters
outThe debug buffer to place the values into.
rbThe contents to place into the output buffer.
Postcondition
The supplied debug buffer contains the contents of the builder.
Returns
The debug buffer post modification. Any sensitive keywords in the builder will have their values obfuscated.

◆ operator<<() [3/4]

DRN_NETWORKING_EXPORT std::ostream & drn::networking::operator<< ( std::ostream & out,
const HttpStatusCode code )

Stream insertion operator.

Parameters
outThe stream to insert the HTTP status code information.
codeThe HTTP status code information to insert into the stream.
Postcondition
The stream contains the HTTP status code information in the form:
  • code [Description]
Returns
The modified stream.

◆ operator<<() [4/4]

DRN_NETWORKING_EXPORT std::ostream & drn::networking::operator<< ( std::ostream & out,
const RequestBuilder & rb )

Stream insertion operator for a request builder into the output buffer.

Parameters
outThe output buffer to place the values into.
rbThe contents to place into the output buffer.
Postcondition
The supplied output buffer contains the contents of the builder.
Returns
The debug buffer post modification. Any sensitive keywords in the builder will have their values obfuscated.

◆ receiveResponse()

DRN_NETWORKING_EXPORT pecunia::Expected< SuccessReply, FailureReply > drn::networking::receiveResponse ( NotifyingSender & sender,
const RequestBuilder & request )
noexcept

Sends a network request and returns the response synchronously. It blocks the calling thread until a response is received, or an error occurs.

Parameters
senderThe means to send the request.
requestThe information to use when constructing the network request.
Returns
The reply from the request sent. Either containing a SuccessReply upon successful communication or a FailureReply if the request fails.

◆ toHttpStatusCode()

DRN_NETWORKING_EXPORT HttpStatusCode drn::networking::toHttpStatusCode ( const std::int32_t value)

Converts an integer value to its corresponding HTTP status code.

Exceptions
logic_errorWhen the supplied value is not a known HTTP status code.
Parameters
valueThe integer representation of the HTTP status code.
Returns
The corresponding HttpStatusCode for the given integer value.

◆ toInteger()

DRN_NETWORKING_EXPORT std::int32_t drn::networking::toInteger ( const HttpStatusCode value)

Converts an HttpStatusCode to its integer representation.

Parameters
valueThe HttpStatusCode to be converted to an integer.
Returns
The integer representation of the given HttpStatusCode.

◆ toStdString()

DRN_NETWORKING_EXPORT std::string drn::networking::toStdString ( const HttpStatusCode value)

Converts an HttpStatusCode to its human-readable representation.

Parameters
valueThe HttpStatusCode to be converted to a string.
Returns
A representation of the given HttpStatusCode.

Variable Documentation

◆ allStatusCodes

const std::array drn::networking::allStatusCodes
inlineconstexpr

Every known HTTP status code.