32 #ifndef _INCLUDE_SOURCEMOD_INTERFACE_DATAPACK_H_
33 #define _INCLUDE_SOURCEMOD_INTERFACE_DATAPACK_H_
35 #include <sp_vm_api.h>
54 virtual void Reset()
const =0;
92 virtual bool IsReadable(
size_t bytes)
const =0;
100 virtual const char *
ReadString(
size_t *len)
const =0;
115 virtual void *
ReadMemory(
size_t *size)
const =0;
141 virtual void PackCell(cell_t cell) =0;
156 virtual void PackString(
const char *
string) =0;
169 virtual size_t CreateMemory(
size_t size,
void **addr) =0;
180 #endif //_INCLUDE_SOURCEMOD_INTERFACE_DATAPACK_H_
virtual void * ReadMemory(size_t *size) const =0
Reads the current position as a generic data type.
virtual void ResetSize()=0
Resets the used size of the stream back to zero.
virtual float ReadFloat() const =0
Reads one float from the data stream.
virtual cell_t ReadCell() const =0
Reads one cell from the data stream.
virtual void PackString(const char *string)=0
Packs one string into the data stream. The length is recorded as well for buffer overrun protection...
Specifies a data pack that can only be read.
Definition: IDataPack.h:48
virtual size_t CreateMemory(size_t size, void **addr)=0
Creates a generic block of memory in the stream.
virtual const char * ReadString(size_t *len) const =0
Reads a string from the data stream.
virtual void * GetMemory() const =0
Reads the current position as a generic address.
virtual void PackFunction(cell_t function)=0
Packs one function pointer into the data stream.
Specifies a data pack that can only be written.
Definition: IDataPack.h:128
Definition: IAdminSystem.h:63
virtual size_t GetPosition() const =0
Retrieves the current stream position.
virtual void Reset() const =0
Resets the position in the data stream to the beginning.
virtual bool SetPosition(size_t pos) const =0
Sets the current stream position.
virtual void PackCell(cell_t cell)=0
Packs one cell into the data stream.
virtual bool IsReadable(size_t bytes) const =0
Returns whether or not a specified number of bytes from the current stream position to the end can be...
virtual void PackFloat(float val)=0
Packs one float into the data stream.
virtual cell_t ReadFunction() const =0
Reads a function pointer from the data stream.