• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

Public Member Functions | List of all members
TDEIOBufferBase Class Referenceabstract

#include <tdeiobuffer.h>

Public Member Functions

 TDEIOBufferBase ()
 
 TDEIOBufferBase (const TDEIOBufferBase &)
 
virtual ~TDEIOBufferBase ()
 
TDEIOBufferBase & operator= (const TDEIOBufferBase &)
 
virtual bool canReadLine () const =0
 
virtual TQCString readLine ()=0
 
virtual TQ_LONG length () const =0
 
bool isEmpty () const
 
virtual TQ_LONG size () const =0
 
bool isFull () const
 
virtual bool setSize (TQ_LONG size)=0
 
virtual TQ_LONG feedBuffer (const char *data, TQ_LONG len)=0
 
virtual TQ_LONG consumeBuffer (char *data, TQ_LONG maxlen, bool discard=true)=0
 
virtual void clear ()=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::TDEBufferedSocket and other buffering classes.

Author
Thiago Macieira thiag.nosp@m.o.ma.nosp@m.cieir.nosp@m.a@kd.nosp@m.email.nosp@m..net

Definition at line 45 of file tdeiobuffer.h.

Constructor & Destructor Documentation

◆ TDEIOBufferBase() [1/2]

TDEIOBufferBase::TDEIOBufferBase ( )
inline

Default constructor.

Does nothing.

Definition at line 51 of file tdeiobuffer.h.

◆ TDEIOBufferBase() [2/2]

TDEIOBufferBase::TDEIOBufferBase ( const TDEIOBufferBase &  )
inline

Copy constructor.

Does nothing here.

Definition at line 57 of file tdeiobuffer.h.

◆ ~TDEIOBufferBase()

virtual TDEIOBufferBase::~TDEIOBufferBase ( )
inlinevirtual

Virtual destructor.

Does nothing.

Definition at line 63 of file tdeiobuffer.h.

Member Function Documentation

◆ canReadLine()

virtual bool TDEIOBufferBase::canReadLine ( ) const
pure virtual

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

◆ clear()

virtual void TDEIOBufferBase::clear ( )
pure virtual

Clears the buffer.

◆ consumeBuffer()

virtual TQ_LONG TDEIOBufferBase::consumeBuffer ( char *  data,
TQ_LONG  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

◆ feedBuffer()

virtual TQ_LONG TDEIOBufferBase::feedBuffer ( const char *  data,
TQ_LONG  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.

◆ isEmpty()

bool TDEIOBufferBase::isEmpty ( ) const
inline

Returns true if the buffer is empty of data.

Definition at line 93 of file tdeiobuffer.h.

◆ isFull()

bool TDEIOBufferBase::isFull ( ) const
inline

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

Definition at line 107 of file tdeiobuffer.h.

◆ length()

virtual TQ_LONG TDEIOBufferBase::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

◆ operator=()

TDEIOBufferBase & TDEIOBufferBase::operator= ( const TDEIOBufferBase &  )
inline

Assignment operator.

Does nothing.

Definition at line 69 of file tdeiobuffer.h.

◆ readLine()

virtual TQCString TDEIOBufferBase::readLine ( )
pure virtual

Reads a line from the buffer and discards it.

◆ setSize()

virtual bool TDEIOBufferBase::setSize ( TQ_LONG  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

◆ size()

virtual TQ_LONG TDEIOBufferBase::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:
  • tdeiobuffer.h

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.