Public Member Functions

SourceMod::IDataReader Class Reference

Specifies a data pack that can only be read. More...

#include <public/IDataPack.h>

Inherited by SourceMod::IDataPack.

List of all members.

Public Member Functions

virtual void Reset () const =0
 Resets the position in the data stream to the beginning.
virtual size_t GetPosition () const =0
 Retrieves the current stream position.
virtual bool SetPosition (size_t pos) const =0
 Sets the current stream position.
virtual cell_t ReadCell () const =0
 Reads one cell from the data stream.
virtual float ReadFloat () const =0
 Reads one float from 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 read.
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 * ReadMemory (size_t *size) const =0
 Reads the current position as a generic data type.

Detailed Description

Specifies a data pack that can only be read.

Definition at line 48 of file IDataPack.h.


Member Function Documentation

virtual size_t SourceMod::IDataReader::GetPosition (  )  const [pure virtual]

Retrieves the current stream position.

Returns:
Index into the stream.
virtual bool SourceMod::IDataReader::SetPosition ( size_t  pos  )  const [pure virtual]

Sets the current stream position.

Parameters:
pos Index to set the stream at.
Returns:
True if succeeded, false if out of bounds.
virtual cell_t SourceMod::IDataReader::ReadCell (  )  const [pure virtual]

Reads one cell from the data stream.

Returns:
A cell read from the current position.
virtual float SourceMod::IDataReader::ReadFloat (  )  const [pure virtual]

Reads one float from the data stream.

Returns:
A float read from the current position.
virtual bool SourceMod::IDataReader::IsReadable ( size_t  bytes  )  const [pure virtual]

Returns whether or not a specified number of bytes from the current stream position to the end can be read.

Parameters:
bytes Number of bytes to simulate reading.
Returns:
True if can be read, false otherwise.
virtual const char* SourceMod::IDataReader::ReadString ( size_t *  len  )  const [pure virtual]

Reads a string from the data stream.

Parameters:
len Optional pointer to store the string length.
Returns:
Pointer to the string, or NULL if out of bounds.
virtual void* SourceMod::IDataReader::GetMemory (  )  const [pure virtual]

Reads the current position as a generic address.

Returns:
Pointer to the memory.
virtual void* SourceMod::IDataReader::ReadMemory ( size_t *  size  )  const [pure virtual]

Reads the current position as a generic data type.

Parameters:
size Optional pointer to store the size of the data type.
Returns:
Pointer to the data, or NULL if out of bounds.

The documentation for this class was generated from the following file: