10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
SimpleBuffer.h
1#ifndef TENDUKE_UTL_SIMPLEBUFFER_H
2#define TENDUKE_UTL_SIMPLEBUFFER_H
3
4#include "./BinaryData.h"
5#include "./DataSink.h"
6
7namespace tenduke { namespace utl {
8
9
13class SimpleBuffer : public BinaryData, public virtual DataSink
14{
15public:
16 SimpleBuffer();
17 ~SimpleBuffer() override;
18
24 void append(const std::uint8_t *newData, size_t newDataLength) override;
25
30 void append(const ::tenduke::utl::DataSpan &data) override;
31
32 void append(std::uint8_t byte) override;
33
34 // tenduke::utl::BinaryData interface
35 unsigned char * getData() const override {return data_;}
36 std::size_t getLength() const override {return length_;}
37
38private:
39 unsigned char * data_;
40 std::size_t length_;
41};
42
43
44}}
45
46#endif // TENDUKE_UTL_SIMPLEBUFFER_H
A sink to which binary data can be appended.
Definition DataSink.h:14
A holder of binary data.
Definition BinaryData.h:14
unsigned char * data() override
Returns a mutable view of the underlying data.
Definition BinaryData.h:28
unsigned char * getData() const override
Returns the data.
Definition SimpleBuffer.h:35
std::size_t getLength() const override
Returns the length of data in bytes.
Definition SimpleBuffer.h:36
void append(const std::uint8_t *newData, size_t newDataLength) override
Appends data to the buffer.
Utilities.
Definition Base64Decoder.h:10
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4