2022-09-07 12:43:34 +00:00
|
|
|
|
/*
|
|
|
|
|
* buffer.hpp
|
|
|
|
|
*
|
|
|
|
|
* Created on: 7 сент. 2022 г.
|
|
|
|
|
* Author: alexander
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
namespace zh
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
class Buffer
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
const unsigned short int _size;
|
|
|
|
|
std::unique_ptr<std::byte[]> _buffer;
|
|
|
|
|
public:
|
|
|
|
|
Buffer(const unsigned short int size);
|
|
|
|
|
const unsigned short int getSize() const;
|
|
|
|
|
const std::string getString() const;
|
|
|
|
|
void clear();
|
2022-09-07 16:09:17 +00:00
|
|
|
|
operator char*();
|
2022-09-07 12:43:34 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|