Source(defaultReader = readPlain, encoding = "unknown", length = NA_integer_,
names = NA_character_, position = 0, vectorized = TRUE, class)
is.Source(x)
## S3 method for class 'Source':
eoi(x)
## S3 method for class 'DataframeSource':
getElem(x)
## S3 method for class 'DirSource':
getElem(x)
## S3 method for class 'URISource':
getElem(x)
## S3 method for class 'VectorSource':
getElem(x)
## S3 method for class 'XMLSource':
getElem(x)
## S3 method for class 'DataframeSource':
pGetElem(x)
## S3 method for class 'DirSource':
pGetElem(x)
## S3 method for class 'VectorSource':
pGetElem(x)
## S3 method for class 'Source':
stepNext(x)
NA_integer_
.Source
is a constructor and should be used when creating
custom sources. Internally a source is represented as a list
with the
class attribute Source
. Custom sources may extend the internal list
structure with additional named components. The function is.Source
returns TRUE
for a valid source and
FALSE
otherwise.
Each source must provide implementations for the three interface functions
eoi
, getElem
, and stepNext
. If vectorized
is set
pGetElem
must be implemented as well. The function eoi
returns
TRUE
if the end of input of the source is reached. getElem
fetches the element at the current position, whereas pGetElem
retrieves
all elements in parallel at once. Retrieved elements must be encapsulated in a
list with the named components content
holding the document and
uri
pointing to the origin of the document (e.g., a file path or a
connection; NA
if not applicable or unavailable). stepNext
increases the position in the source to the next element.
getSources
to list available sources;
readPlain
;
Encoding
.