Qore Qdx Module Reference  1.1
Qdx::QorePostProcessingInputStreamLineIterator Class Reference

a line-based input stream iterator for post-processing HTML and JS files created for Qore documentation More...

Inheritance diagram for Qdx::QorePostProcessingInputStreamLineIterator:

Public Member Methods

 constructor (Qore::InputStream is, *string encoding, *string eol, bool do_trim=False)
 
 constructor (Qore::StreamReader sr, *string eol, bool do_trim=False)
 
string getLine ()
 Returns the processed version of the current line in the input data or throws an ITERATOR-ERROR exception if the iterator is invalid. More...
 
string getValue ()
 Returns the processed version of the current line in the input data or throws an ITERATOR-ERROR exception if the iterator is invalid. More...
 

Detailed Description

a line-based input stream iterator for post-processing HTML and JS files created for Qore documentation

Member Function Documentation

◆ constructor() [1/2]

Qdx::QorePostProcessingInputStreamLineIterator::constructor ( Qore::InputStream  is,
*string  encoding,
*string  eol,
bool  do_trim = False 
)

Creates the object for iterating over the given InputStream

Parameters
isthe InputStream to iterate over
encodingcharacter encoding of the data from input stream; if not ASCII-compatible, all data will be converted to UTF-8; if not present, the default character encoding is assumed
eolthe optional end of line character(s) to use to detect lines in the data; if this string is not passed, then the end of line character(s) are detected automatically, and can be either "\n", "\r", or "\r\n"
do_trimif True the string return values for the lines iterated will be trimmed of the eol bytes
Exceptions
ENCODING-CONVERSION-ERRORthis exception could be thrown if the eol argument has a different character encoding from the data's and an error occurs during encoding conversion

◆ constructor() [2/2]

Qdx::QorePostProcessingInputStreamLineIterator::constructor ( Qore::StreamReader  sr,
*string  eol,
bool  do_trim = False 
)

Creates the object for iterating over the given StreamReader

Parameters
srthe StreamReader to iterate over
eolthe optional end of line character(s) to use to detect lines in the data; if this string is not passed, then the end of line character(s) are detected automatically, and can be either "\n", "\r", or "\r\n"
do_trimif True the string return values for the lines iterated will be trimmed of the eol bytes
Exceptions
ENCODING-CONVERSION-ERRORthis exception could be thrown if the eol argument has a different character encoding from the data's and an error occurs during encoding conversion

◆ getLine()

string Qdx::QorePostProcessingInputStreamLineIterator::getLine ( )
virtual

Returns the processed version of the current line in the input data or throws an ITERATOR-ERROR exception if the iterator is invalid.

Example:
map printf("+ %y\n", i.getLine()), i;
Returns
the current line in the data or throws an ITERATOR-ERROR exception if the iterator is invalid
Exceptions
ITERATOR-ERRORthe iterator is not pointing at a valid element
ITERATOR-THREAD-ERRORthis exception is thrown if this method is called from any thread other than the thread that created the object
See also
getValue()

Reimplemented from Qore::InputStreamLineIterator.

Reimplemented in Qdx::QorePostProcessingTexInputStreamLineIterator.

◆ getValue()

string Qdx::QorePostProcessingInputStreamLineIterator::getValue ( )
virtual

Returns the processed version of the current line in the input data or throws an ITERATOR-ERROR exception if the iterator is invalid.

Example:
map printf("+ %y\n", i.getValue()), i;
Returns
the current line in the data or throws an ITERATOR-ERROR exception if the iterator is invalid
Exceptions
ITERATOR-ERRORthe iterator is not pointing at a valid element
ITERATOR-THREAD-ERRORthis exception is thrown if this method is called from any thread other than the thread that created the object
See also
getLine()

Reimplemented from Qore::InputStreamLineIterator.

Reimplemented in Qdx::QorePostProcessingTexInputStreamLineIterator.

printf
string printf(string fmt,...)