-
Notifications
You must be signed in to change notification settings - Fork 1
serializer.document stream
load serializer.document-stream
This module provides the Serializer.DocumentStream class which add location informations to read data from a text document.
This class creates a convenient interface for reading and writing data on a text document. It provides informations such as current line and column number.
| Modifiers | Member | Description |
|---|---|---|
const |
<< | Writes the string data to the stream, and returns a reference to the stream. ... |
const |
>> | Reads a word from the stream and stores it in data, then returns a reference ... |
class |
InvalidDocument | This class provides the context of an invalid content exception. |
const |
getCodec | Returns the codec that is current assigned to the stream. It correspond to th... |
const |
getColumnNumber | Returns the column number of the read cursor position. |
const |
getLineNumber | Returns the line number of the read cursor position. |
const |
isEmpty | Returns true if the stream has no more data to read; otherwise returns false. |
const |
new | Creates a new stream for reading and writing data using stream. |
const |
read | Reads all remaining data from the stream, and returns it as a string. |
const |
readChar | Reads the next character from the stream, and returns it as a string. Data is... |
const |
readLine | Reads the next line from the stream, and returns it as a string. Data is read... |
const |
readLines | Returns an iterator on each remaining lines of the stream. |
const |
readWord | Reads a word from the stream, and returns it as a string. Words are separated... |
const |
setCodec | Forwards the codec to the underlying object. |
const |
toTextStream | Returns the internal instance of Serializer.DocumentStream.Serializer.TextStream... |
const |
write | Writes the content of data to the stream. The write method of the underlying ... |
| Modifiers | Member | Description |
|---|---|---|
final |
column | Internal column number. |
final |
line | Internal line number. |
final |
stream | Internal underlying stream. |
This class provides the context of an invalid content exception.
| Modifiers | Member | Description |
|---|---|---|
const |
getColumnNumber | Returns the error column number. |
const |
getDocument | Returns the document that raised the error. |
const |
getError | Returns the error message. |
const |
getLineNumber | Returns the error line number. |
const |
new | Create a new instance of the exception for the given document at the current ... |
const |
toString | Returns the exception informations as a string. |
| Modifiers | Member | Description |
|---|---|---|
final |
column | Internal column number. |
final |
document | Internal document. |
final |
error | Internal error message. |
final |
line | Internal line number. |
def (self, data)
Writes the string data to the stream, and returns a reference to the
stream. The string is first encoded using the assigned codec (the default
is UTF-8) before it is written to the stream.
def (self, data)
Reads a word from the stream and stores it in data, then returns a
reference to the stream. Words are separated by whitespace (i.e., all
characters for which isSpace returns true).
Leading whitespace are skipped.
0
Internal column number.
null
Internal document.
''
Internal error message.
def (const self)
Returns the error column number.
def (const self)
Returns the document that raised the error.
def (const self)
Returns the error message.
def (const self)
Returns the error line number.
1
Internal line number.
def (self, document, error)
Create a new instance of the exception for the given document at
the current position with an error message.
def (const self)
Returns the exception informations as a string.
0
Internal column number.
def (const self)
Returns the codec that is current assigned to the stream. It correspond to the codec of the underlying stream.
def (const self)
Returns the column number of the read cursor position.
def (const self)
Returns the line number of the read cursor position.
def (const self)
Returns true if the stream has no more data to read; otherwise returns
false.
1
Internal line number.
def (self, stream)
Creates a new stream for reading and writing data using stream.
def (self)
Reads all remaining data from the stream, and returns it as a string.
def (self)
Reads the next character from the stream, and returns it as a string. Data is read until a valid character is read or if the end of stream is detected.
def (self)
Reads the next line from the stream, and returns it as a string.
Data is read until a '\n' character is read or if the end of
stream is detected.
def (self)
Returns an iterator on each remaining lines of the stream.
def (self)
Reads a word from the stream, and returns it as a string. Words are
separated by whitespace (i.e., all characters for which isSpace
returns true).
Leading whitespace are skipped.
def (self, codec)
Forwards the codec to the underlying object.
null
Internal underlying stream.
def (self)
Returns the internal instance of Serializer.TextStream used for read and write operations on the document.
def (self, data)
Writes the content of data to the stream.
The write method of the underlying object is used to write the data.
- Introduction
- Variables
-
Built-in-types
- Built-in-types#none
- Built-in-types#null
- Built-in-types#boolean
- Built-in-types#number
- Built-in-types#string
- Built-in-types#regex
- Built-in-types#array
- Built-in-types#hash
- Built-in-types#iterator
- Built-in-types#async_iterator
- Built-in-types#package
- Built-in-types#function
- Built-in-types#coroutine
- Built-in-types#library
- Built-in-types#libobject
- Arithmetic-operations
- Type-casting
- Control-structures
- Function-definition
- User-defined-types
- Work-with-modules