R-Type
R-Type project
KapMirror::NetworkWriter Class Reference

Public Member Functions

 NetworkWriter (int size)
 
void reset ()
 Reset the position to 0.
 
template<typename T >
void write (T value)
 Write a value to the buffer. More...
 
byte * toArray ()
 Get the buffer. More...
 
 operator byte * ()
 
std::shared_ptr< ArraySegment< byte > > toArraySegment ()
 Get the buffer. More...
 
int size () const
 Get the size of the buffer. More...
 
void writeBytes (byte *array, int offset, int count)
 Write a byte array to the buffer. More...
 
void writeString (const std::string &value)
 Write a string to the buffer. More...
 
void writeArraySegment (const std::shared_ptr< ArraySegment< byte >> &value)
 

Member Function Documentation

◆ size()

int KapMirror::NetworkWriter::size ( ) const
inline

Get the size of the buffer.

Returns
Size

◆ toArray()

byte* KapMirror::NetworkWriter::toArray ( )
inline

Get the buffer.

Returns
Array of bytes

◆ toArraySegment()

std::shared_ptr<ArraySegment<byte> > KapMirror::NetworkWriter::toArraySegment ( )
inline

Get the buffer.

Returns
ArraySegment<char>

◆ write()

template<typename T >
void KapMirror::NetworkWriter::write ( value)
inline

Write a value to the buffer.

Template Parameters
TThe type of the value
Parameters
valueValue

◆ writeBytes()

void KapMirror::NetworkWriter::writeBytes ( byte *  array,
int  offset,
int  count 
)
inline

Write a byte array to the buffer.

Parameters
arrayArray
offsetOffset
countCount

◆ writeString()

void KapMirror::NetworkWriter::writeString ( const std::string &  value)
inline

Write a string to the buffer.

Parameters
valueValue

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