21 #ifndef INCLUDE_OLA_IO_MEMORYBUFFER_H_ 22 #define INCLUDE_OLA_IO_MEMORYBUFFER_H_ 25 #include <ola/io/InputBuffer.h> 40 explicit MemoryBuffer(
const uint8_t *data,
unsigned int size)
47 unsigned int Read(uint8_t *data,
unsigned int length) {
48 unsigned int data_size = std::min(m_size - m_cursor, length);
49 memcpy(data, m_data + m_cursor, data_size);
50 m_cursor += data_size;
54 unsigned int Read(std::string *output,
unsigned int length) {
55 unsigned int data_size = std::min(m_size - m_cursor, length);
56 output->append(reinterpret_cast<const char*>(m_data + m_cursor),
58 m_cursor += data_size;
63 const uint8_t *m_data;
64 const unsigned int m_size;
65 unsigned int m_cursor;
71 #endif // INCLUDE_OLA_IO_MEMORYBUFFER_H_ Definition: MemoryBuffer.h:38
unsigned int Read(uint8_t *data, unsigned int length)
Definition: MemoryBuffer.h:47
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44