\doxysection{Qore\+::Pipe\+Input\+Stream Class Reference}
\hypertarget{class_qore_1_1_pipe_input_stream}{}\label{class_qore_1_1_pipe_input_stream}\index{Qore::PipeInputStream@{Qore::PipeInputStream}}


This class is not intended to be instantiated directly, please see \doxylink{class_qore_1_1_stream_pipe}{Stream\+Pipe}.  




{\ttfamily \#include $<$QC\+\_\+\+Pipe\+Input\+Stream.\+dox.\+h$>$}



Inheritance diagram for Qore\+::Pipe\+Input\+Stream\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=207pt]{class_qore_1_1_pipe_input_stream__inherit__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{class_qore_1_1_pipe_input_stream_ad8bd2da8c43c2ca2596c25216ea9a2c8}\label{class_qore_1_1_pipe_input_stream_ad8bd2da8c43c2ca2596c25216ea9a2c8} 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} {\bfseries finish\+Close} ()
\begin{DoxyCompactList}\small\item\em Call when the background operation is finished to wakeup \doxylink{class_qore_1_1_pipe_output_stream_ac5c91f4c13fd56c359c02027c71ff3d3}{Pipe\+Output\+Stream\+::close()}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_pipe_input_stream_a1bbdc70f26a18e3fd78dd87477d6138e}{peek}} ()
\begin{DoxyCompactList}\small\item\em Peeks the next byte available from the input stream; returns -\/1 if no more data available. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{class_qore_1_1_pipe_input_stream_a262618fb179b875385f49993a90baa07}{read}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{limit}})
\begin{DoxyCompactList}\small\item\em Reads bytes (up to a specified limit) from the input stream; returns \doxysectlink{basic_data_types_NOTHING}{NOTHING}{2} if there are no more bytes in the stream. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_pipe_input_stream_ab55abf0bd84b4b6ba95698f03315ec24}{report\+Error}} (\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{ex}})
\begin{DoxyCompactList}\small\item\em Causes all operations on both pipe streams to wake up and throw an exception. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}}}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_qore_1_1_input_stream_afa843e81a854eeb13f215a76da80cea4}{constructor}} ()
\begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{abstract}} \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_input_stream_a165db4108c3a1f4bbb6b619972fd131c}{peek}} ()
\begin{DoxyCompactList}\small\item\em Peeks the next byte available from the input stream; returns -\/1 if no more data available. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{abstract}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{class_qore_1_1_input_stream_a74ba0bc85bb86988a0f8b3255d1dbf01}{read}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{limit}})
\begin{DoxyCompactList}\small\item\em Reads bytes (up to a specified limit) from the input stream; returns \doxysectlink{basic_data_types_NOTHING}{NOTHING}{2} if there are no more bytes in the stream. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \mbox{\hyperlink{class_qore_1_1_stream_base}{Qore\+::\+Stream\+Base}}}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_qore_1_1_stream_base_ae1c3dbffc3da7bdc8e16e8ad41302552}{constructor}} ()
\begin{DoxyCompactList}\small\item\em Throws an exception if called directly; this class can only be instantiated by builtin subclasses. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} {\bfseries get\+Thread\+Id} ()
\begin{DoxyCompactList}\small\item\em Get the currently assigned thread id or -\/1 if not assigned to any thread. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_stream_base_ab6b33cb1944c46aca8e9984ddfd65452}{reassign\+Thread}} ()
\begin{DoxyCompactList}\small\item\em Reassigns current thread as thread used for stream manipulation. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} \mbox{\hyperlink{class_qore_1_1_stream_base_a017fc847a42d5c670cb9640a94522666}{unassign\+Thread}} ()
\begin{DoxyCompactList}\small\item\em Unassigns current thread as thread used for stream manipulation. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{class_qore_1_1_pipe_input_stream_a857d2ce5a82baeac618850ca49305fad}\label{class_qore_1_1_pipe_input_stream_a857d2ce5a82baeac618850ca49305fad} 
{\bfseries constructor} ()
\begin{DoxyCompactList}\small\item\em Creates the \doxylink{class_qore_1_1_pipe_input_stream}{Pipe\+Input\+Stream}. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This class is not intended to be instantiated directly, please see \doxylink{class_qore_1_1_stream_pipe}{Stream\+Pipe}. 

\begin{DoxyNote}{Note}
stream classes are not designed to be accessed from multiple threads; they have been implemented without locking for fast and efficient use when used from a single thread. For methods that would be unsafe to use in another thread, any use of such methods in threads other than the thread where the constructor was called will cause a {\ttfamily STREAM-\/\+THREAD-\/\+ERROR} to be thrown, unless the stream is handed off to another thread using the \doxylink{class_qore_1_1_stream_base_a017fc847a42d5c670cb9640a94522666}{Stream\+Base\+::unassign\+Thread()} method in the thread that currently owns the stream, and the \doxylink{class_qore_1_1_stream_base_ab6b33cb1944c46aca8e9984ddfd65452}{Stream\+Base\+::reassign\+Thread()} method in the new thread.
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}

\begin{DoxyItemize}
\item \doxylink{class_qore_1_1_stream_reader}{Stream\+Reader} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{for} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{a} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{class} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{that} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{can} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{be} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{used} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{to} \doxylink{class_qore_1_1_pipe_input_stream_a262618fb179b875385f49993a90baa07}{read} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{various} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{kinds} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{of} data \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{from} \doxylink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{an} \doxylink{class_qore_1_1_input_stream}{Input\+Stream}
\item \doxylink{class_qore_1_1_stream_pipe}{Stream\+Pipe}
\end{DoxyItemize}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}


\doxysubsection{Member Function Documentation}
\Hypertarget{class_qore_1_1_pipe_input_stream_a1bbdc70f26a18e3fd78dd87477d6138e}\label{class_qore_1_1_pipe_input_stream_a1bbdc70f26a18e3fd78dd87477d6138e} 
\index{Qore::PipeInputStream@{Qore::PipeInputStream}!peek@{peek}}
\index{peek@{peek}!Qore::PipeInputStream@{Qore::PipeInputStream}}
\doxysubsubsection{\texorpdfstring{peek()}{peek()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Pipe\+Input\+Stream\+::peek (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Peeks the next byte available from the input stream; returns -\/1 if no more data available. 

\begin{DoxyReturn}{Returns}
the next byte available from the input stream or -\/1 if no more data is available 
\end{DoxyReturn}
\Hypertarget{class_qore_1_1_pipe_input_stream_a262618fb179b875385f49993a90baa07}\label{class_qore_1_1_pipe_input_stream_a262618fb179b875385f49993a90baa07} 
\index{Qore::PipeInputStream@{Qore::PipeInputStream}!read@{read}}
\index{read@{read}!Qore::PipeInputStream@{Qore::PipeInputStream}}
\doxysubsubsection{\texorpdfstring{read()}{read()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} Qore\+::\+Pipe\+Input\+Stream\+::read (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{limit }\end{DoxyParamCaption})}



Reads bytes (up to a specified limit) from the input stream; returns \doxysectlink{basic_data_types_NOTHING}{NOTHING}{2} if there are no more bytes in the stream. 


\begin{DoxyExceptions}{Exceptions}
{\em INPUT-\/\+STREAM-\/\+ERROR} & {\itshape limit} is not positive \\
\hline
\end{DoxyExceptions}
\Hypertarget{class_qore_1_1_pipe_input_stream_ab55abf0bd84b4b6ba95698f03315ec24}\label{class_qore_1_1_pipe_input_stream_ab55abf0bd84b4b6ba95698f03315ec24} 
\index{Qore::PipeInputStream@{Qore::PipeInputStream}!reportError@{reportError}}
\index{reportError@{reportError}!Qore::PipeInputStream@{Qore::PipeInputStream}}
\doxysubsubsection{\texorpdfstring{reportError()}{reportError()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{nothing}} Qore\+::\+Pipe\+Input\+Stream\+::report\+Error (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}}]{ex }\end{DoxyParamCaption})}



Causes all operations on both pipe streams to wake up and throw an exception. 

Normally used from the background thread to report an error to the main thread. 
\begin{DoxyParams}{Parameters}
{\em ex} & the exception, must contain strings \textquotesingle{}err\textquotesingle{} and \textquotesingle{}desc\textquotesingle{} \\
\hline
\end{DoxyParams}
