32#ifndef _QORE_INPUTSTREAMLINEITERATOR_H
33#define _QORE_INPUTSTREAMLINEITERATOR_H
38#include "qore/InputStream.h"
39#include "qore/intern/BufferedStreamReader.h"
40#include "qore/intern/StreamReader.h"
41#include "qore/intern/EncodingConversionInputStream.h"
58 if (assignEol(n_eol, xsink))
69 enc(sr->getEncoding()),
76 if (assignEol(n_eol, xsink))
80 if (enc != sr->getEncoding())
93 if (validp && line && !line->
empty()) {
97 validp = getLine(xsink);
108 DLLLOCAL
int64 index()
const {
117 DLLLOCAL
bool valid()
const {
123 xsink->
raiseException(
"ITERATOR-ERROR",
"the %s is not pointing at a valid element; make sure %s::next() returns True before calling this method", getName(), getName());
142 DLLLOCAL
virtual const char* getName()
const {
return "InputStreamLineIterator"; }
144 DLLLOCAL
virtual const QoreTypeInfo* getElementType()
const {
145 return stringTypeInfo;
150 if (!n_eol || n_eol->
empty())
156 eol = q_remove_bom_utf16(neol.release(), enc);
167 line = reader->
readLine(eol, trim, xsink);
DLLLOCAL void ref() const
increments the reference count of the object
Definition: AbstractPrivateData.h:51
Private data for the Qore::BufferedStreamReader class.
Definition: BufferedStreamReader.h:45
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:50
DLLEXPORT AbstractQoreNode * raiseException(const char *err, const char *fmt,...)
appends a Qore-language exception to the list
defines string encoding functions in Qore
Definition: QoreEncoding.h:83
abstract base class for iterator private data
Definition: QoreIteratorBase.h:68
DLLEXPORT bool ROdereference() const
atomically decrements the reference count
DLLEXPORT const QoreEncoding * getEncoding() const
returns the encoding for the string
DLLEXPORT bool empty() const
returns true if the string is empty, false if not
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:50
DLLEXPORT QoreStringNode * convertEncoding(const QoreEncoding *nccs, ExceptionSink *xsink) const
converts the encoding of the string to the specified encoding, returns 0 if an error occurs,...
DLLEXPORT QoreStringNode * stringRefSelf() const
references the object and returns a non-const pointer to "this"
a templated class to manage a reference count of an object that can throw a Qore-language exception w...
Definition: ReferenceHolder.h:52
manages a reference count of a pointer to a class that takes a simple "deref()" call with no argument...
Definition: ReferenceHolder.h:127
Private data for the Qore::StreamReader class.
Definition: StreamReader.h:45
DLLLOCAL QoreStringNode * readLine(const QoreStringNode *eol, bool trim, ExceptionSink *xsink)
Read one line.
Definition: StreamReader.h:126
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition: common.h:260