-
Notifications
You must be signed in to change notification settings - Fork 2
serializer.documentstream
load serializer.documentstream
This module provides the Serializer.DocumentStream class which add location informations to read data from a text document.
This class creates a conveniant 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 referenc... |
+ class
|
InvalidDocument | This class provides the context of an invalid content exception. |
- final
|
column | Internal column number. |
+ 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 fa ... |
- final
|
line | Internal line number. |
+ 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 underling object. |
- final
|
stream | Internal underling stream. |
+ const
|
toTextStream | Returns the internal instance of Serializer.TextStream used for read and writ... |
+ const
|
write | Writes the content of data to the stream. The write method of the underli... |
This class provides the context of an invalid content exception.
Modifiers | Member | Description |
---|---|---|
- final
|
column | Internal column number. |
- final
|
document | Internal document. |
- final
|
error | Internal error message. |
+ 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. |
- final
|
line | Internal line number. |
+ const
|
new | Create a new instance of the exception for the given document at the curren... |
+ const
|
toString | Returns the exception informations as a string. |
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 underling 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 underling object.
null
Internal underling 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 underling object is used to write the data.
Language reference
- Introduction
- Variables
- Built-in types
- Arithmetic operations
- Type casting
- Control structures
- Function definition
- User defined types
- Work with modules
Library reference