\section{KIOBuffer\-Base Class Reference}
\label{classKIOBufferBase}\index{KIOBufferBase@{KIOBufferBase}}
base for I/O buffer implementation  


{\tt \#include $<$kiobuffer.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KIOBuffer\-Base} ()
\item 
{\bf KIOBuffer\-Base} (const {\bf KIOBuffer\-Base} \&)
\item 
virtual {\bf $\sim$KIOBuffer\-Base} ()
\item 
{\bf KIOBuffer\-Base} \& {\bf operator=} (const {\bf KIOBuffer\-Base} \&)
\item 
virtual bool {\bf can\-Read\-Line} () const =0
\item 
virtual {\bf QCString} {\bf read\-Line} ()=0
\item 
virtual Q\_\-LONG {\bf length} () const =0
\item 
bool {\bf is\-Empty} () const 
\item 
virtual Q\_\-LONG {\bf size} () const =0
\item 
bool {\bf is\-Full} () const 
\item 
virtual bool {\bf set\-Size} (Q\_\-LONG size)=0
\item 
virtual Q\_\-LONG {\bf feed\-Buffer} (const char $\ast$data, Q\_\-LONG len)=0
\item 
virtual Q\_\-LONG {\bf consume\-Buffer} (char $\ast$data, Q\_\-LONG maxlen, bool discard=true)=0
\item 
virtual void {\bf clear} ()=0
\end{CompactItemize}


\subsection{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 {\bf KNetwork::KBuffered\-Socket}{\rm (p.\,\pageref{classKNetwork_1_1KBufferedSocket})} and other buffering classes.

\begin{Desc}
\item[Author:]Thiago Macieira $<${\tt thiago.macieira@kdemail.net}$>$ \end{Desc}




Definition at line 45 of file kiobuffer.h.

\subsection{Constructor \& Destructor Documentation}
\index{KIOBufferBase@{KIOBuffer\-Base}!KIOBufferBase@{KIOBufferBase}}
\index{KIOBufferBase@{KIOBufferBase}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KIOBuffer\-Base::KIOBuffer\-Base ()\hspace{0.3cm}{\tt  [inline]}}\label{classKIOBufferBase_a0}


Default constructor. 

Does nothing. 

Definition at line 51 of file kiobuffer.h.\index{KIOBufferBase@{KIOBuffer\-Base}!KIOBufferBase@{KIOBufferBase}}
\index{KIOBufferBase@{KIOBufferBase}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KIOBuffer\-Base::KIOBuffer\-Base (const {\bf KIOBuffer\-Base} \&)\hspace{0.3cm}{\tt  [inline]}}\label{classKIOBufferBase_a1}


Copy constructor. 

Does nothing here. 

Definition at line 57 of file kiobuffer.h.\index{KIOBufferBase@{KIOBuffer\-Base}!~KIOBufferBase@{$\sim$KIOBufferBase}}
\index{~KIOBufferBase@{$\sim$KIOBufferBase}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual KIOBuffer\-Base::$\sim${\bf KIOBuffer\-Base} ()\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKIOBufferBase_a2}


Virtual destructor. 

Does nothing. 

Definition at line 63 of file kiobuffer.h.

\subsection{Member Function Documentation}
\index{KIOBufferBase@{KIOBuffer\-Base}!operator=@{operator=}}
\index{operator=@{operator=}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KIOBuffer\-Base}\& KIOBuffer\-Base::operator= (const {\bf KIOBuffer\-Base} \&)\hspace{0.3cm}{\tt  [inline]}}\label{classKIOBufferBase_a3}


Assignment operator. 

Does nothing. 

Definition at line 69 of file kiobuffer.h.\index{KIOBufferBase@{KIOBuffer\-Base}!canReadLine@{canReadLine}}
\index{canReadLine@{canReadLine}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KIOBuffer\-Base::can\-Read\-Line () const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKIOBufferBase_a4}


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

\index{KIOBufferBase@{KIOBuffer\-Base}!readLine@{readLine}}
\index{readLine@{readLine}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QCString} KIOBuffer\-Base::read\-Line ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKIOBufferBase_a5}


Reads a line from the buffer and discards it. 

\index{KIOBufferBase@{KIOBuffer\-Base}!length@{length}}
\index{length@{length}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual Q\_\-LONG KIOBuffer\-Base::length () const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKIOBufferBase_a6}


Returns the number of bytes in the buffer. 

Note that this is not the size of the buffer.

\begin{Desc}
\item[See also:]{\bf size}{\rm (p.\,\pageref{classKIOBufferBase_a8})} \end{Desc}


Referenced by is\-Empty(), and is\-Full().\index{KIOBufferBase@{KIOBuffer\-Base}!isEmpty@{isEmpty}}
\index{isEmpty@{isEmpty}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KIOBuffer\-Base::is\-Empty () const\hspace{0.3cm}{\tt  [inline]}}\label{classKIOBufferBase_a7}


Returns true if the buffer is empty of data. 



Definition at line 93 of file kiobuffer.h.

References length().\index{KIOBufferBase@{KIOBuffer\-Base}!size@{size}}
\index{size@{size}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual Q\_\-LONG KIOBuffer\-Base::size () const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKIOBufferBase_a8}


Retrieves the buffer size. 

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

\begin{Desc}
\item[See also:]{\bf length}{\rm (p.\,\pageref{classKIOBufferBase_a6})} for the {\bf length}{\rm (p.\,\pageref{classKIOBufferBase_a6})} of the data stored \end{Desc}


Referenced by is\-Full().\index{KIOBufferBase@{KIOBuffer\-Base}!isFull@{isFull}}
\index{isFull@{isFull}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KIOBuffer\-Base::is\-Full () const\hspace{0.3cm}{\tt  [inline]}}\label{classKIOBufferBase_a9}


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



Definition at line 107 of file kiobuffer.h.

References length(), and size().\index{KIOBufferBase@{KIOBuffer\-Base}!setSize@{setSize}}
\index{setSize@{setSize}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KIOBuffer\-Base::set\-Size (Q\_\-LONG {\em size})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKIOBufferBase_a10}


Sets the size of the buffer, if allowed. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em size}]the maximum size, use -1 for unlimited. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true on success, false if an error occurred. \end{Desc}
\begin{Desc}
\item[Note:]if the new size is less than {\bf length()}{\rm (p.\,\pageref{classKIOBufferBase_a6})}, the buffer will be truncated \end{Desc}
\index{KIOBufferBase@{KIOBuffer\-Base}!feedBuffer@{feedBuffer}}
\index{feedBuffer@{feedBuffer}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual Q\_\-LONG KIOBuffer\-Base::feed\-Buffer (const char $\ast$ {\em data}, Q\_\-LONG {\em len})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKIOBufferBase_a11}


Adds data to the end of the buffer. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]the data to be added \item[{\em len}]the data length, in bytes \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the number of bytes added to the end of the buffer. \end{Desc}
\index{KIOBufferBase@{KIOBuffer\-Base}!consumeBuffer@{consumeBuffer}}
\index{consumeBuffer@{consumeBuffer}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual Q\_\-LONG KIOBuffer\-Base::consume\-Buffer (char $\ast$ {\em data}, Q\_\-LONG {\em maxlen}, bool {\em discard} = {\tt true})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKIOBufferBase_a12}


Consumes data from the beginning of the buffer. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]where to copy the data to \item[{\em maxlen}]the maximum length to copy, in bytes \item[{\em discard}]if true, the bytes copied will be discarded \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the number of bytes copied from the buffer \end{Desc}
\index{KIOBufferBase@{KIOBuffer\-Base}!clear@{clear}}
\index{clear@{clear}!KIOBufferBase@{KIOBuffer\-Base}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KIOBuffer\-Base::clear ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKIOBufferBase_a13}


Clears the buffer. 



The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
kiobuffer.h\end{CompactItemize}
