\hypertarget{class_qore_1_1_abstract_line_iterator}{}\section{Qore\+:\+:Abstract\+Line\+Iterator Class Reference}
\label{class_qore_1_1_abstract_line_iterator}\index{Qore\+::\+Abstract\+Line\+Iterator@{Qore\+::\+Abstract\+Line\+Iterator}}


This class defines an abstract interface for line iterators.  




Inheritance diagram for Qore\+:\+:Abstract\+Line\+Iterator\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_qore_1_1_abstract_line_iterator__inherit__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
abstract \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_abstract_line_iterator_a8ad4c0503f09b24e93bbeac266f2b2a0}{get\+Line}} ()
\begin{DoxyCompactList}\small\item\em Returns the current line in the data or throws an {\ttfamily I\+N\+V\+A\+L\+I\+D-\/\+I\+T\+E\+R\+A\+T\+OR} exception if the iterator is invalid. \end{DoxyCompactList}\item 
abstract \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_abstract_line_iterator_acc1342afce2820c3d1dded7aeb2b8dd8}{get\+Value}} ()
\begin{DoxyCompactList}\small\item\em Returns the current line in the data or throws an {\ttfamily I\+N\+V\+A\+L\+I\+D-\/\+I\+T\+E\+R\+A\+T\+OR} exception if the iterator is invalid. \end{DoxyCompactList}\item 
abstract \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_abstract_line_iterator_acde61f19ac0b96adcaafbe4962e9a335}{index}} ()
\begin{DoxyCompactList}\small\item\em Returns the current iterator line number (the first line is line 1) or 0 if not pointing at a valid element. \end{DoxyCompactList}\item 
abstract bool \mbox{\hyperlink{class_qore_1_1_abstract_line_iterator_ac5f7742a325b335f3cd2ab0bb5f37272}{next}} ()
\begin{DoxyCompactList}\small\item\em Moves the current position to the next line; returns \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if there are no more lines to read. \end{DoxyCompactList}\item 
abstract bool \mbox{\hyperlink{class_qore_1_1_abstract_line_iterator_a06fc51d01bfae9f17f290ac247ffd3f3}{valid}} ()
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if the iterator is currently pointing at a valid element, \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if not. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This class defines an abstract interface for line iterators. 

Classes inheriting this class can be used to iterate lines from various sources.

\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1_abstract_line_iterator_a8ad4c0503f09b24e93bbeac266f2b2a0}\label{class_qore_1_1_abstract_line_iterator_a8ad4c0503f09b24e93bbeac266f2b2a0}} 
\index{Qore\+::\+Abstract\+Line\+Iterator@{Qore\+::\+Abstract\+Line\+Iterator}!get\+Line@{get\+Line}}
\index{get\+Line@{get\+Line}!Qore\+::\+Abstract\+Line\+Iterator@{Qore\+::\+Abstract\+Line\+Iterator}}
\subsubsection{\texorpdfstring{get\+Line()}{getLine()}}
{\footnotesize\ttfamily abstract \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Abstract\+Line\+Iterator\+::get\+Line (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns the current line in the data or throws an {\ttfamily I\+N\+V\+A\+L\+I\+D-\/\+I\+T\+E\+R\+A\+T\+OR} exception if the iterator is invalid. 

\begin{DoxyReturn}{Returns}
the current line in the data
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{while} (i.next()) \{
    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"+ %y\(\backslash\)n"}, i.getLine());
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em I\+N\+V\+A\+L\+I\+D-\/\+I\+T\+E\+R\+A\+T\+OR} & the iterator is not pointing at a valid element \\
\hline
\end{DoxyExceptions}


Implemented in \mbox{\hyperlink{class_qore_1_1_file_line_iterator_a0d738d5e8d770c1e50baf275e9ca3981}{Qore\+::\+File\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_data_line_iterator_affdfe2642623b31f782eda63e98f5d76}{Qore\+::\+Data\+Line\+Iterator}}, and \mbox{\hyperlink{class_qore_1_1_input_stream_line_iterator_a97843613b1efffb8191a982b034ad35e}{Qore\+::\+Input\+Stream\+Line\+Iterator}}.

\mbox{\Hypertarget{class_qore_1_1_abstract_line_iterator_acc1342afce2820c3d1dded7aeb2b8dd8}\label{class_qore_1_1_abstract_line_iterator_acc1342afce2820c3d1dded7aeb2b8dd8}} 
\index{Qore\+::\+Abstract\+Line\+Iterator@{Qore\+::\+Abstract\+Line\+Iterator}!get\+Value@{get\+Value}}
\index{get\+Value@{get\+Value}!Qore\+::\+Abstract\+Line\+Iterator@{Qore\+::\+Abstract\+Line\+Iterator}}
\subsubsection{\texorpdfstring{get\+Value()}{getValue()}}
{\footnotesize\ttfamily abstract \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Abstract\+Line\+Iterator\+::get\+Value (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns the current line in the data or throws an {\ttfamily I\+N\+V\+A\+L\+I\+D-\/\+I\+T\+E\+R\+A\+T\+OR} exception if the iterator is invalid. 

This method calls \mbox{\hyperlink{class_qore_1_1_abstract_line_iterator_a8ad4c0503f09b24e93bbeac266f2b2a0}{Abstract\+Line\+Iterator\+::get\+Line()}} internally. \begin{DoxyReturn}{Returns}
the current line in the data
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{while} (i.next()) \{
    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"+ %y\(\backslash\)n"}, i.getValue());
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em I\+N\+V\+A\+L\+I\+D-\/\+I\+T\+E\+R\+A\+T\+OR} & the iterator is not pointing at a valid element\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_abstract_line_iterator_a8ad4c0503f09b24e93bbeac266f2b2a0}{Abstract\+Line\+Iterator\+::get\+Line()}} 
\end{DoxySeeAlso}


Implements \mbox{\hyperlink{class_qore_1_1_abstract_iterator_a1f7b94aa7237f59c4f959f4d33333d9a}{Qore\+::\+Abstract\+Iterator}}.



Implemented in \mbox{\hyperlink{class_qore_1_1_file_line_iterator_a83dc18c41ade9e9503d3d21785accbd3}{Qore\+::\+File\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_input_stream_line_iterator_ac20e677f7b65af6efcad994e8baffcf0}{Qore\+::\+Input\+Stream\+Line\+Iterator}}, and \mbox{\hyperlink{class_qore_1_1_data_line_iterator_a0d695de4158d1f10ded8071ae96d3b88}{Qore\+::\+Data\+Line\+Iterator}}.

\mbox{\Hypertarget{class_qore_1_1_abstract_line_iterator_acde61f19ac0b96adcaafbe4962e9a335}\label{class_qore_1_1_abstract_line_iterator_acde61f19ac0b96adcaafbe4962e9a335}} 
\index{Qore\+::\+Abstract\+Line\+Iterator@{Qore\+::\+Abstract\+Line\+Iterator}!index@{index}}
\index{index@{index}!Qore\+::\+Abstract\+Line\+Iterator@{Qore\+::\+Abstract\+Line\+Iterator}}
\subsubsection{\texorpdfstring{index()}{index()}}
{\footnotesize\ttfamily abstract \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Abstract\+Line\+Iterator\+::index (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns the current iterator line number (the first line is line 1) or 0 if not pointing at a valid element. 

\begin{DoxyReturn}{Returns}
the current iterator line number (the first line is line 1) or 0 if not pointing at a valid element
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{while} (i.next()) \{
    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"+ %d: %y\(\backslash\)n"}, i.index(), i.getLine());
\}
\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_file_line_iterator_a9eb374145fd48a41420b96684ff895f5}{Qore\+::\+File\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_input_stream_line_iterator_ac2a16a29cd14271505149e96c144c814}{Qore\+::\+Input\+Stream\+Line\+Iterator}}, and \mbox{\hyperlink{class_qore_1_1_data_line_iterator_a2e9f211ca438b8b3f8a122b040ce46ae}{Qore\+::\+Data\+Line\+Iterator}}.

\mbox{\Hypertarget{class_qore_1_1_abstract_line_iterator_ac5f7742a325b335f3cd2ab0bb5f37272}\label{class_qore_1_1_abstract_line_iterator_ac5f7742a325b335f3cd2ab0bb5f37272}} 
\index{Qore\+::\+Abstract\+Line\+Iterator@{Qore\+::\+Abstract\+Line\+Iterator}!next@{next}}
\index{next@{next}!Qore\+::\+Abstract\+Line\+Iterator@{Qore\+::\+Abstract\+Line\+Iterator}}
\subsubsection{\texorpdfstring{next()}{next()}}
{\footnotesize\ttfamily abstract bool Qore\+::\+Abstract\+Line\+Iterator\+::next (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Moves the current position to the next line; returns \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if there are no more lines to read. 

This method will return \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} again after it returns \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} once if data is not empty, otherwise it will always return \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}. The iterator object should not be used after this method returns \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}.

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if there are no more lines in the source (in which case the iterator object is invalid and should not be used); \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if successful (meaning that the iterator object is valid)
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{while} (i.next()) \{
    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"line: %y\(\backslash\)n"}, i.getLine());
\}
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \mbox{\hyperlink{class_qore_1_1_abstract_iterator_ab10d5694cc2fcd3b6689ea7494da79de}{Qore\+::\+Abstract\+Iterator}}.



Implemented in \mbox{\hyperlink{class_qore_1_1_file_line_iterator_a9e6ad34f365bfeb5e4bcd045daf43921}{Qore\+::\+File\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_input_stream_line_iterator_a15869ee0a81ae224334f83f681b6e760}{Qore\+::\+Input\+Stream\+Line\+Iterator}}, and \mbox{\hyperlink{class_qore_1_1_data_line_iterator_afa97a63c0d6f6ae2410ae3c7ae68696e}{Qore\+::\+Data\+Line\+Iterator}}.

\mbox{\Hypertarget{class_qore_1_1_abstract_line_iterator_a06fc51d01bfae9f17f290ac247ffd3f3}\label{class_qore_1_1_abstract_line_iterator_a06fc51d01bfae9f17f290ac247ffd3f3}} 
\index{Qore\+::\+Abstract\+Line\+Iterator@{Qore\+::\+Abstract\+Line\+Iterator}!valid@{valid}}
\index{valid@{valid}!Qore\+::\+Abstract\+Line\+Iterator@{Qore\+::\+Abstract\+Line\+Iterator}}
\subsubsection{\texorpdfstring{valid()}{valid()}}
{\footnotesize\ttfamily abstract bool Qore\+::\+Abstract\+Line\+Iterator\+::valid (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if the iterator is currently pointing at a valid element, \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if not. 

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if the iterator is currently pointing at a valid element, \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{if} (i.valid())
    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"current value: %y\(\backslash\)n"}, i.getValue());
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \mbox{\hyperlink{class_qore_1_1_abstract_iterator_aee1def5d872b487b8917a166d9b263e8}{Qore\+::\+Abstract\+Iterator}}.



Implemented in \mbox{\hyperlink{class_qore_1_1_file_line_iterator_a93c4a650206085736f7bf8efe89ff613}{Qore\+::\+File\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_data_line_iterator_af64f428889d1af031d68da288f2f9dbe}{Qore\+::\+Data\+Line\+Iterator}}, and \mbox{\hyperlink{class_qore_1_1_input_stream_line_iterator_ad67679ac159cec3362a5faed21f0dcdb}{Qore\+::\+Input\+Stream\+Line\+Iterator}}.

