Input Method
Provides input to the reader.
Syntax
idocreader.input(text, [callback])
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for this method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
The reader gets the text input via the Text parameter. The Text is sent to the reader's state machine and any available events are fired as a result of the parsing process.
The events are fired only when qualifying conditions (such as when a new segment is found) are met. In the meantime, text will be buffered internally.
Any buffered text will be flushed out to the ExtraData property when Reset is called.
Since the class can be used to parse IDoc data fragments, the internal buffer will not be cleared until Reset is called. So Reset must be called before loading a new document.
Example (Parse an IDoc File)
IDocReader.Input("idocdata")