Prusa MINI Firmware overview
ConstHeader Class Reference

ConstHeader only point to const chars defined in code. More...

#include <lwsapi_app.hpp>

Inheritance diagram for ConstHeader:
Collaboration diagram for ConstHeader:

Public Member Functions

 ConstHeader (const char *const key, const char *const value, IHeader *next=nullptr)
 
virtual size_t length () const override
 
virtual void snprintf (char *buff) const override
 
virtual void dbg () const override
 
- Public Member Functions inherited from IHeader
 IHeader (const char *const key, IHeader *next=nullptr)
 
- Public Member Functions inherited from LwIPClass
virtual ~LwIPClass ()
 

Public Attributes

const char * value
 
- Public Attributes inherited from IHeader
const char * key
 
IHeadernext
 

Additional Inherited Members

- Static Public Member Functions inherited from LwIPClass
static voidoperator new (size_t size)
 
static void operator delete (void *ptr)
 
- Static Protected Attributes inherited from IHeader
static const size_t format_chars = 5
 

Detailed Description

ConstHeader only point to const chars defined in code.

Constructor & Destructor Documentation

◆ ConstHeader()

ConstHeader::ConstHeader ( const char *const  key,
const char *const  value,
IHeader next = nullptr 
)
122  : IHeader(key, next)
123  , value(value) {}

Member Function Documentation

◆ length()

virtual size_t ConstHeader::length ( ) const
overridevirtual

Implements IHeader.

125  {
126  return strlen(key) + strlen(value) + format_chars;
127  }
Here is the caller graph for this function:

◆ snprintf()

virtual void ConstHeader::snprintf ( char *  buff) const
overridevirtual

Implements IHeader.

129  {
130  ::snprintf(buff, length(), "%s: %s\r\n", key, value);
131  }
Here is the call graph for this function:

◆ dbg()

virtual void ConstHeader::dbg ( ) const
overridevirtual

Implements IHeader.

133  {
134  lwsapi_dbg("Header: [%s]:'%s'", key, value);
135  }

Member Data Documentation

◆ value

const char* ConstHeader::value
ConstHeader::value
const char * value
Definition: lwsapi_app.hpp:118
IHeader::key
const char * key
Definition: lwsapi_app.hpp:72
ConstHeader::length
virtual size_t length() const override
Definition: lwsapi_app.hpp:125
lwsapi_dbg
#define lwsapi_dbg
Definition: lwsapi_app.hpp:41
IHeader::next
IHeader * next
Definition: lwsapi_app.hpp:73
IHeader::IHeader
IHeader(const char *const key, IHeader *next=nullptr)
Definition: lwsapi_app.hpp:75
ConstHeader::snprintf
virtual void snprintf(char *buff) const override
Definition: lwsapi_app.hpp:129
IHeader::format_chars
static const size_t format_chars
Definition: lwsapi_app.hpp:84