PixelLightAPI  .
Public Member Functions
PLCore::Buffer Class Reference

Network buffer. More...

#include <Buffer.h>

List of all members.

Public Member Functions

PLCORE_API Buffer (uint32 nSize=0)
 Constructor.
PLCORE_API Buffer (const Buffer &cSource)
 Copy constructor.
 ~Buffer ()
 Destructor.
bool GetRemoveLineDelimiters () const
 Get option for removing line delimiters.
void SetRemoveLineDelimiters (bool bRemoveDelimiters)
 Set option for removing line delimiters.
PLCORE_API void Clear ()
 Clear buffer.
PLCORE_API void Allocate (uint32 nSize)
 Allocates a new buffer (all previous data will be lost)
uint32 GetSize () const
 Get current buffer size.
PLCORE_API void Add (const char *pData, uint32 nSize)
 Add data to the buffer.
PLCORE_API String GetLine ()
 Get a line from the buffer.
PLCORE_API Bufferoperator= (const Buffer &cSource)
 Copy operator.
const char * GetData () const
 Get data.
char * GetData ()
 Get data.

Detailed Description

Network buffer.

Remarks:
This buffer can be used within concrete network implementations to manage send/received network data.

Constructor & Destructor Documentation

PLCORE_API PLCore::Buffer::Buffer ( uint32  nSize = 0)

Constructor.

Parameters:
[in]nSizeSize of the buffer in bytes, if 0, no buffer is allocated
PLCORE_API PLCore::Buffer::Buffer ( const Buffer cSource)

Copy constructor.

Parameters:
[in]cSourceSource to copy from

Destructor.


Member Function Documentation

bool PLCore::Buffer::GetRemoveLineDelimiters ( ) const [inline]

Get option for removing line delimiters.

Returns:
'true' if line delimiters shall be removed, else 'false'
void PLCore::Buffer::SetRemoveLineDelimiters ( bool  bRemoveDelimiters) [inline]

Set option for removing line delimiters.

Parameters:
[in]bRemoveDelimiters'true' if line delimiters shall be removed, else 'false'
PLCORE_API void PLCore::Buffer::Clear ( )

Clear buffer.

PLCORE_API void PLCore::Buffer::Allocate ( uint32  nSize)

Allocates a new buffer (all previous data will be lost)

Parameters:
[in]nSizeSize of the buffer in bytes, if 0, no buffer is allocated (same as just Clear())
uint32 PLCore::Buffer::GetSize ( ) const [inline]

Get current buffer size.

Returns:
The current buffer size in bytes
PLCORE_API void PLCore::Buffer::Add ( const char *  pData,
uint32  nSize 
)

Add data to the buffer.

Parameters:
[in]pDataData to add, if a null pointer nothing happens
[in]nSizeSize of the data to add in bytes (MUST be correct!)

Get a line from the buffer.

Returns:
The read line, empty string on error
Note:
  • The read line is removed from buffer

  • will be replaced by \0.
PLCORE_API Buffer& PLCore::Buffer::operator= ( const Buffer cSource)

Copy operator.

Parameters:
[in]cSourceSource to copy from
Returns:
Reference to this instance
const char * PLCore::Buffer::GetData ( ) const [inline]

Get data.

Returns:
Pointer to buffer
char * PLCore::Buffer::GetData ( ) [inline]

Get data.

Returns:
Pointer to buffer

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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:26
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported