• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

Public Member Functions | List of all members
KIOBufferBase Class Referenceabstract

#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.

Author
Thiago Macieira thiag.nosp@m.o@kd.nosp@m.e.org
Deprecated:
Use KSocketFactory or KLocalSocket instead

Definition at line 44 of file k3iobuffer.h.

Constructor & Destructor Documentation

KIOBufferBase::KIOBufferBase ( )
inline

Default constructor.

Does nothing.

Definition at line 50 of file k3iobuffer.h.

KIOBufferBase::KIOBufferBase ( const KIOBufferBase &  )
inline

Copy constructor.

Does nothing here.

Definition at line 56 of file k3iobuffer.h.

virtual KIOBufferBase::~KIOBufferBase ( )
inlinevirtual

Virtual destructor.

Does nothing.

Definition at line 62 of file k3iobuffer.h.

Member Function Documentation

virtual bool KIOBufferBase::canReadLine ( ) const
pure virtual

Returns true if a line can be read from the buffer.

virtual void KIOBufferBase::clear ( )
pure virtual

Clears the buffer.

virtual qint64 KIOBufferBase::consumeBuffer ( char *  data,
qint64  maxlen,
bool  discard = true 
)
pure virtual

Consumes data from the beginning of the buffer.

Parameters
datawhere to copy the data to
maxlenthe maximum length to copy, in bytes
discardif true, the bytes copied will be discarded
Returns
the number of bytes copied from the buffer
virtual qint64 KIOBufferBase::feedBuffer ( const char *  data,
qint64  len 
)
pure virtual

Adds data to the end of the buffer.

Parameters
datathe data to be added
lenthe data length, in bytes
Returns
the number of bytes added to the end of the buffer.
bool KIOBufferBase::isEmpty ( ) const
inline

Returns true if the buffer is empty of data.

Definition at line 92 of file k3iobuffer.h.

bool KIOBufferBase::isFull ( ) const
inline

Returns true if the buffer is full (i.e., cannot receive more data)

Definition at line 106 of file k3iobuffer.h.

virtual qint64 KIOBufferBase::length ( ) const
pure virtual

Returns the number of bytes in the buffer.

Note that this is not the size of the buffer.

See also
size
KIOBufferBase& KIOBufferBase::operator= ( const KIOBufferBase &  )
inline

Assignment operator.

Does nothing.

Definition at line 68 of file k3iobuffer.h.

virtual qint64 KIOBufferBase::readLine ( char *  data,
qint64  maxlen 
)
pure virtual

Reads a line from the buffer and discards it.

virtual bool KIOBufferBase::setSize ( qint64  size)
pure virtual

Sets the size of the buffer, if allowed.

Parameters
sizethe 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
virtual qint64 KIOBufferBase::size ( ) const
pure virtual

Retrieves the buffer size.

The value of -1 indicates that the buffer has no defined upper limit.

See also
length for the length of the data stored

The documentation for this class was generated from the following file:
  • k3iobuffer.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal