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 Buffer & | operator= (const Buffer &cSource) |
| Copy operator.
|
const char * | GetData () const |
| Get data.
|
char * | GetData () |
| Get data.
|
Detailed Description
Constructor & Destructor Documentation
Constructor.
- Parameters:
-
[in] | nSize | Size of the buffer in bytes, if 0, no buffer is allocated |
Copy constructor.
- Parameters:
-
[in] | cSource | Source to copy from |
Member Function Documentation
Get option for removing line delimiters.
- Returns:
- 'true' if line delimiters shall be removed, else 'false'
Set option for removing line delimiters.
- Parameters:
-
[in] | bRemoveDelimiters | 'true' if line delimiters shall be removed, else 'false' |
Allocates a new buffer (all previous data will be lost)
- Parameters:
-
[in] | nSize | Size of the buffer in bytes, if 0, no buffer is allocated (same as just Clear()) |
Get current buffer size.
- Returns:
- The current buffer size in bytes
Add data to the buffer.
- Parameters:
-
[in] | pData | Data to add, if a null pointer nothing happens |
[in] | nSize | Size 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] | cSource | Source to copy from |
- Returns:
- Reference to this instance
Get data.
- Returns:
- Pointer to buffer
Get data.
- Returns:
- Pointer to buffer
The documentation for this class was generated from the following files: