Prusa MINI Firmware overview
Environment Class Reference

Environment struct like as WSGI environment as possible could be. More...

#include <lwsapi_app.hpp>

Collaboration diagram for Environment:

Public Member Functions

 Environment ()
 
 ~Environment ()
 
void add_header (IHeader *header)
 
const IHeaderget_headers () const
 

Public Attributes

char method [METHOD_LENGTH] = { '\0' }
 
char request_uri [URI_LENGTH] = { '\0' }
 

Detailed Description

Environment struct like as WSGI environment as possible could be.

Constructor & Destructor Documentation

◆ Environment()

Environment::Environment ( )
187  : headers(nullptr)
188  , last(nullptr) {}

◆ ~Environment()

Environment::~Environment ( )
190  {
191  auto it = headers;
192  IHeader *next = nullptr;
193  while (it != nullptr) {
194  next = it->next;
195  delete it;
196  it = next;
197  }
198  }

Member Function Documentation

◆ add_header()

void Environment::add_header ( IHeader header)
28  {
29  if (headers == nullptr) {
30  headers = header;
31  last = headers;
32  } else {
33  last->next = header;
34  last = header;
35  }
36 }

◆ get_headers()

const IHeader* Environment::get_headers ( ) const
201  {
202  return headers;
203  }

Member Data Documentation

◆ method

char Environment::method[METHOD_LENGTH] = { '\0' }

HTTP METHOD (GET|POST|etc..)

◆ request_uri

char Environment::request_uri[URI_LENGTH] = { '\0' }

Full HTTP request uri

IHeader
Headers list. Creator is responsible to clean the values.
Definition: lwsapi_app.hpp:70
pbuf::next
struct pbuf * next
Definition: pbuf.h:144
IHeader::next
IHeader * next
Definition: lwsapi_app.hpp:73