InputBuffer.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * InputBuffer.h
8  *
9  ****/
10 
11 #pragma once
12 
13 #include <user_config.h>
14 
15 namespace Ssl
16 {
21 {
22 public:
23  InputBuffer(pbuf* buf) : buf(buf)
24  {
25  }
26 
27  size_t available() const
28  {
29  return buf ? (buf->tot_len - offset) : 0;
30  }
31 
32  size_t read(uint8_t* buffer, size_t bufSize);
33 
34 private:
35  pbuf* buf;
36  uint16_t offset = 0;
37 };
38 
39 } // namespace Ssl
size_t read(uint8_t *buffer, size_t bufSize)
Wraps a pbuf for reading in chunks.
Definition: InputBuffer.h:20
Definition: Alert.h:15
InputBuffer(pbuf *buf)
Definition: InputBuffer.h:23
size_t available() const
Definition: InputBuffer.h:27