Prusa MINI Firmware overview
ByteSkipper Class Reference

#include <parsetools.h>

Public Member Functions

 ByteSkipper ()
 
void Initialize (MultiValueBuffer *pbuf)
 
bool Skip (uint8_t **pp, uint16_t *pcntdn, uint16_t bytes_to_skip)
 

Constructor & Destructor Documentation

◆ ByteSkipper()

ByteSkipper::ByteSkipper ( )
63  : pBuf(nullptr), nStage(0), countDown(0) {
64  }

Member Function Documentation

◆ Initialize()

void ByteSkipper::Initialize ( MultiValueBuffer pbuf)
66  {
67  pBuf = (uint8_t*)pbuf->pValue;
68  countDown = 0;
69  }
Here is the caller graph for this function:

◆ Skip()

bool ByteSkipper::Skip ( uint8_t **  pp,
uint16_t *  pcntdn,
uint16_t  bytes_to_skip 
)
71  {
72  switch (nStage) {
73  case 0:
74  countDown = bytes_to_skip;
75  nStage++;
76  case 1:
77  for (; countDown && (*pcntdn); countDown--, (*pp)++, (*pcntdn)--);
78 
79  if (!countDown)
80  nStage = 0;
81  }
82  return (!countDown);
83  }
uint8_t
const uint8_t[]
Definition: 404_html.c:3
pbuf
Definition: pbuf.h:142