mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
allow cbuf as chain
This commit is contained in:
parent
46c096ba23
commit
fa38ce4079
@ -22,7 +22,7 @@
|
|||||||
#include "c_types.h"
|
#include "c_types.h"
|
||||||
|
|
||||||
cbuf::cbuf(size_t size) :
|
cbuf::cbuf(size_t size) :
|
||||||
_size(size), _buf(new char[size]), _bufend(_buf + size), _begin(_buf), _end(_begin) {
|
next(NULL), _size(size), _buf(new char[size]), _bufend(_buf + size), _begin(_buf), _end(_begin) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cbuf::~cbuf() {
|
cbuf::~cbuf() {
|
||||||
|
@ -56,6 +56,8 @@ class cbuf {
|
|||||||
void flush();
|
void flush();
|
||||||
size_t remove(size_t size);
|
size_t remove(size_t size);
|
||||||
|
|
||||||
|
cbuf *next;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline char* wrap_if_bufend(char* ptr) const {
|
inline char* wrap_if_bufend(char* ptr) const {
|
||||||
return (ptr == _bufend) ? _buf : ptr;
|
return (ptr == _bufend) ? _buf : ptr;
|
||||||
@ -66,6 +68,7 @@ class cbuf {
|
|||||||
const char* _bufend;
|
const char* _bufend;
|
||||||
char* _begin;
|
char* _begin;
|
||||||
char* _end;
|
char* _end;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif//__cbuf_h
|
#endif//__cbuf_h
|
||||||
|
Loading…
x
Reference in New Issue
Block a user