#include <sue_sess.hpp>
Public Methods | |
SUEBuffer () | |
Constructor. | |
~SUEBuffer () | |
Destructor. | |
void | AddData (const char *buf, int size) |
Add some data to the end. | |
int | GetData (char *buf, int bufsize) |
Move data from the buffer. | |
void | DropData (int len) |
Drop some data. | |
void | EraseData (int index, int len) |
Erase given range from the buffer. | |
void | DropAll () |
Empty the buffer. | |
void | AddChar (char c) |
Add a char to the end of the buffer. | |
void | AddString (const char *str) |
Add a string to the end of the buffer. | |
int | ReadLine (char *buf, int bufsize) |
Read a line. | |
bool | ReadLine (SUEBuffer &buf) |
Read a line into another buffer. | |
int | FindLineMarker (const char *marker) const |
Find the given line in the buffer. | |
int | ReadUntilLineMarker (const char *marker, char *buf, int bufsize) |
bool | ReadUntilLineMarker (const char *marker, SUEBuffer &dest) |
bool | ContainsExactText (const char *str) const |
Does the buffer contain exactly given text. | |
const char * | GetBuffer () const |
Return the pointer to the actual data. | |
int | Length () const |
How much data is in the buffer. | |
char & | operator[] (int i) const |
Access the given byte. |
chat.cpp, and hellobot.cpp.
|
Constructor.
|
|
Destructor.
|
|
Add a char to the end of the buffer.
|
|
Add some data to the end. The buffer is enlarged and data is added |
|
Add a string to the end of the buffer. The string pointed by str is added to the buffer. Terminating zero is not copied, only the string itself. |
|
Does the buffer contain exactly given text. Checks if the buffer's content is exactly the same as in the given zero-terminated string. |
|
Empty the buffer.
|
|
Drop some data. The first len bytes in the buffer are removed. If the buffer contains less than len bytes, it is just emptied. |
|
Erase given range from the buffer.
|
|
Find the given line in the buffer.
returns the index of the ' |
|
Return the pointer to the actual data.
|
|
Move data from the buffer. The first bufsize bytes from the buffer are copied to the user-supplied memory pointed by buf. If the object contains less data than bufsize, then all the present data is copied. The method returns count of the copied bytes. The copied data is removed from the buffer. |
|
How much data is in the buffer. How many bytes does the buffer contain
|
|
Access the given byte.
|
|
Read a line into another buffer. Checks whether a text line (that is, something terminated by the EOL character) is available at the beginning of the buffer. If so, copy it to the user-supplied buffer and remove it from the buffer.
|
|
Read a line. Checks whether a text line (that is, something terminated by the EOL character) is available at the beginning of the buffer. If so, copy it to the user-supplied memory and remove it from the buffer.
|
|
|
|
|