Devel Lib
Buffer.h
1 #pragma once
2 
3 #include <Core/Exceptions.h>
4 #include <Core/Typedef.h>
5 #include <cstring>
6 
9 namespace Devel::IO {
12  static auto NoBufferException = std::logic_error("Buffer is nullptr!");
13 
16  static auto IndexOutOfRangeException = std::range_error("Index out of range!");
17 
49  class IBuffer {
50  public:
54  virtual const char *buffer() const = 0;
55 
59  virtual char *rawBuffer() const = 0;
60 
64  virtual size_t size() const = 0;
65  };
66 }
This file contains a series of type definitions for the codebase.
An interface for working with byte buffers.
Definition: Buffer.h:49
virtual const char * buffer() const =0
Get a constant pointer to the start of the buffer.
virtual size_t size() const =0
Get the size of the buffer.
virtual char * rawBuffer() const =0
Get a mutable pointer to the start of the buffer.
The namespace encapsulating I/O related classes and functions in the Devel framework.