oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ove::http::Response Class Reference

RAII wrapper around an oveRTOS HTTP response. More...

#include <net_http.hpp>

Public Member Functions

 Response ()=default
 Constructs an empty response.
 
 ~Response () noexcept
 Destroys the response, freeing body and header buffers.
 
 Response (const Response &)=delete
 
Responseoperator= (const Response &)=delete
 
 Response (Response &&other) noexcept
 Move constructor – transfers ownership of response buffers.
 
Responseoperator= (Response &&other) noexcept
 Move-assignment operator – frees current buffers and takes ownership.
 
int status () const
 Returns the HTTP status code (e.g. 200, 404).
 
const char * body () const
 Returns the response body (NUL-terminated).
 
size_t body_len () const
 Returns the response body length in bytes.
 
const char * headers () const
 Returns the raw response headers.
 
size_t headers_len () const
 Returns the response headers length in bytes.
 
ove_http_response_t * raw ()
 Returns a pointer to the underlying C response struct.
 

Public Attributes

ove_http_response_t raw_ {}
 

Detailed Description

RAII wrapper around an oveRTOS HTTP response.

Owns the body and header buffers returned by an HTTP request. Frees them automatically on destruction.

Note
Non-copyable; movable. The moved-from object is left in a zeroed (empty) state.

Constructor & Destructor Documentation

◆ Response()

ove::http::Response::Response ( Response &&  other)
inlinenoexcept

Move constructor – transfers ownership of response buffers.

Parameters
otherThe source; its raw response is zeroed after the move.

Member Function Documentation

◆ operator=()

Response & ove::http::Response::operator= ( Response &&  other)
inlinenoexcept

Move-assignment operator – frees current buffers and takes ownership.

Parameters
otherThe source; its raw response is zeroed after the move.
Returns
Reference to this object.

◆ raw()

ove_http_response_t * ove::http::Response::raw ( )
inline

Returns a pointer to the underlying C response struct.

Returns
Pointer to the raw ove_http_response_t.

Member Data Documentation

◆ raw_

ove_http_response_t ove::http::Response::raw_ {}

Underlying C response struct (populated by the client).


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