KDECore
#include <k3iobuffer.h>
Public Member Functions | |
KIOBufferBase () | |
KIOBufferBase (const KIOBufferBase &) | |
virtual | ~KIOBufferBase () |
virtual bool | canReadLine () const =0 |
virtual void | clear ()=0 |
virtual qint64 | consumeBuffer (char *data, qint64 maxlen, bool discard=true)=0 |
virtual qint64 | feedBuffer (const char *data, qint64 len)=0 |
bool | isEmpty () const |
bool | isFull () const |
virtual qint64 | length () const =0 |
KIOBufferBase & | operator= (const KIOBufferBase &) |
virtual qint64 | readLine (char *data, qint64 maxlen)=0 |
virtual bool | setSize (qint64 size)=0 |
virtual qint64 | size () const =0 |
Detailed Description
base for I/O buffer implementation
This class declares the base methods to interface with an I/O buffer. Most applications will not need to access this class directly, since it is all handled by KNetwork::KBufferedSocket and other buffering classes.
- Deprecated
- Use KSocketFactory or KLocalSocket instead
Definition at line 44 of file k3iobuffer.h.
Constructor & Destructor Documentation
◆ KIOBufferBase() [1/2]
|
inline |
◆ KIOBufferBase() [2/2]
|
inline |
◆ ~KIOBufferBase()
|
inlinevirtual |
Member Function Documentation
◆ canReadLine()
Returns true if a line can be read from the buffer.
◆ clear()
◆ consumeBuffer()
|
pure virtual |
Consumes data from the beginning of the buffer.
- Parameters
-
data where to copy the data to maxlen the maximum length to copy, in bytes discard if true, the bytes copied will be discarded
- Returns
- the number of bytes copied from the buffer
◆ feedBuffer()
Adds data to the end of the buffer.
- Parameters
-
data the data to be added len the data length, in bytes
- Returns
- the number of bytes added to the end of the buffer.
◆ isEmpty()
|
inline |
Returns true if the buffer is empty of data.
Definition at line 92 of file k3iobuffer.h.
◆ isFull()
|
inline |
Returns true if the buffer is full (i.e., cannot receive more data)
Definition at line 106 of file k3iobuffer.h.
◆ length()
Returns the number of bytes in the buffer.
Note that this is not the size of the buffer.
- See also
- size
◆ operator=()
|
inline |
◆ readLine()
Reads a line from the buffer and discards it.
◆ setSize()
Sets the size of the buffer, if allowed.
- Parameters
-
size the maximum size, use -1 for unlimited.
- Returns
- true on success, false if an error occurred.
- Note
- if the new size is less than length(), the buffer will be truncated
◆ size()
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.