-
Notifications
You must be signed in to change notification settings - Fork 1
serializer.yaml stream
load serializer.yaml-stream
This module provides the Serializer.YamlStream class which allow to read and write YAML documents.
This class represents a YAML alias. An alias node is denoted by the *
indicator. The alias refers to the most recent preceding node having the same
anchor.
| Modifiers | Member | Description |
|---|---|---|
const |
data | Returns the data of the referenced node. |
const |
new | Creates a new alias node. The document parameter must be the instance of Seri... |
const |
node | Returns the referenced node. |
const |
toString | Returns the string representation of the alias. |
| Modifiers | Member | Description |
|---|---|---|
final |
anchor | Internal anchor. |
final |
document | Internal document. |
This class represents a YAML comment.
| Modifiers | Member | Description |
|---|---|---|
const |
new | Creates a new comment for the content described by content. If the content pa... |
const |
toString | Returns the string representation of the comment. |
| Modifiers | Member | Description |
|---|---|---|
final |
content | Internal content text. |
This class represents a YAML directive. Each document may be associated with a set of directives. A directive has a name and an optional sequence of parameters.
| Modifiers | Member | Description |
|---|---|---|
const |
getComment | Returns the comment associated to the directive or none if no comment were sp... |
const |
getName | Returns the name of the directive. |
const |
getParameters | Returns the parameters sequence of the directive. |
const |
new | Creates a new directive with the given name name and parameters parameters se... |
const |
setComment | Sets the comment associated to the directive. |
const |
toString | Returns the string representation of the processing instruction. |
| Modifiers | Member | Description |
|---|---|---|
final |
comment | Internal comment. |
final |
name | Internal directive name. |
final |
parameters | Internal parameters set. |
This class represents a YAML document. A YAML document starts with the
sequence --- and ends with an optional sequence ... or with the begining
of the next document or the end of the stream. Each document is completely
independent from the rest.
| Modifiers | Member | Description |
|---|---|---|
const |
append | Appends node at the end of the document. |
const |
data | Returns the content of the document as a sequence of hashes and arrays corres... |
const |
getAlias | Returns the alias target of the anchor anchor. |
const |
getRootNode | Returns the root node of the document. |
const |
isEmpty | Returns true if the document is empty; otherwise returns false. |
const |
remove | Removes node from the document. |
const |
setAlias | Sets the alias target of the anchor anchor to node. |
const |
setRootNode | Sets the root node of the document. |
const |
toString | Returns the string representation of the document. |
| Modifiers | Member | Description |
|---|---|---|
final |
aliases | Internal aliases. |
final |
comments | Internal comment. |
final |
root | Internal root node. |
This class represents a YAML mapping. The content of a mapping node is an unordered set of key/value node pairs, with the restriction that each of the keys is unique. YAML places no further restrictions on the nodes. In particular, keys may be arbitrary nodes, the same node may be used as the value of several key/value pairs and a mapping could even contain itself as a key or a value.
| Modifiers | Member | Description |
|---|---|---|
const |
clear | Resets the mapping. |
const |
data | Returns the content of the mapping as a sequence of hashes and arrays corresp... |
const |
in | Returns true if the mapping contains key; otherwise returns false. |
const |
insert | Inserts the node node with the key given by key. If key is already contained ... |
const |
isEmpty | Returns true if the mapping is empty; otherwise returns false. |
const |
new | Creates a new empty mapping node. |
const |
remove | Removes key and the associated value from the document. |
const |
size | Returns the number of elements in the mapping. |
const |
toHash | Returns the content of the mapping as a sequence of hashes and arrays corresp... |
const |
toString | Returns the string representation of the mapping for the indentation level gi... |
| Modifiers | Member | Description |
|---|---|---|
final |
children | Internal child node mapping. |
This class represents a YAML scalar. The content of a scalar node is an opaque datum that can be presented as a series of zero or more Unicode characters.
| Modifiers | Member | Description |
|---|---|---|
const |
!= | Returns false if other is the same node than self; otherwise returns true. |
const |
== | Returns true if other is the same node than self; otherwise returns false. |
const |
data | Returns the content of the scalar as an instance of string, number, boolean, ``... |
const |
getTag | Returns the Serializer.YamlScalar.Serializer.YamlTag of the node. |
const |
new | Creates a new empty scalar node. |
const |
setTag | Sets the Serializer.YamlScalar.Serializer.YamlTag of the node. |
const |
toCanonicalForm | Returns the string representation of the scalar in its canonical form. |
const |
toString | Returns the string representation of the scalar. |
| Modifiers | Member | Description |
|---|---|---|
final |
tag | Internal tag. |
final |
value | Internal value. |
This class represents a YAML sequence. The content of a sequence node is an ordered series of zero or more nodes. In particular, a sequence may contain the same node more than once. It could even contain itself.
| Modifiers | Member | Description |
|---|---|---|
const |
append | Appends node at the end of the sequence. |
const |
clear | Resets the sequence. |
const |
data | Returns the content of the sequence as a sequence of hashes and arrays corres... |
const |
in | Returns true if the sequence contains node; otherwise returns false. |
const |
indexOf | Returns the index of the node node if contained in the sequence; otherwise re... |
const |
insert | Inserts the node node at the index given by index. If index is negative, the ... |
const |
isEmpty | Returns true if the sequence is empty; otherwise returns false. |
const |
lastIndexOf | Returns the index of the node node if contained in the sequence; otherwise re... |
const |
new | Creates a new empty sequence node. |
const |
remove | Removes node from the sequence. |
const |
size | Returns the number of nodes in the sequence. |
const |
toArray | Returns the content of the sequence as a sequence of hashes and arrays corres... |
const |
toString | Returns the string representation of the sequence for the indentation level g... |
| Modifiers | Member | Description |
|---|---|---|
final |
children | Internal child node sequence. |
This class class provides a way to read and write YAML documents.
| Modifiers | Member | Description |
|---|---|---|
override const
|
<< | Writes the content of data to the stream using the Serializer.YamlStream.write ... |
override const
|
>> | Reads an object from the stream and stores it in data, then returns a referen... |
override const
|
read | Reads the content of the stream and return it as an instance of Serializer.Ya... |
override const
|
write | Writes the content of data to the stream. |
| Modifiers | Member | Description |
|---|---|---|
class |
Parser | This class provides a parser to convert a YAML stream to objects. |
This class provides a parser to convert a YAML stream to objects.
| Modifiers | Member | Description |
|---|---|---|
const |
new | Creates a new parser on the stream given by stream. |
const |
parse | Returns an instance of Serializer.YamlStream.Parser.Serializer.YamlDocument c... |
| Modifiers | Member | Description |
|---|---|---|
final |
c | Internal last read character. |
final const
|
discardToken | Discards the last token that was read. The same token will then be returned b... |
final |
discarded | Internal discarded state. |
final |
document | Internal current document node. |
final const
|
getColumnNumber | Returns the input stream current column number. |
final const
|
getLineNumber | Returns the input stream current line number. |
final const
|
nextChar | Returns the next character of the stream. |
final const
|
nextToken | Returns the next token of the stream. A token is a character that does not ma... |
final const
|
parseBlockString | Reads the content of a YAML block string. An instance of Serializer.YamlStrea... |
final const
|
parseDocument | Reads the content of a document. Returns an instance of Serializer.YamlStream... |
final const
|
parseDoubleQuotedString | Reads the content of a YAML double quoted string. An instance of Serializer.Y... |
final const
|
parseInlineMapping | Reads the content of a YAML inline mapping. An instance of Serializer.YamlStr... |
final const
|
parseInlineSequence | Reads the content of a YAML inline sequence. An instance of Serializer.YamlSt... |
final const
|
parseMapping | Reads the content of a YAML mapping. An instance of Serializer.YamlStream.Par... |
final const
|
parseMergedMapping | Reads the content of a YAML merged mapping. An instance of Serializer.YamlStr... |
final const
|
parseNewLine | Reads the content of a new line. An instance of Serializer.YamlStream.Parser.... |
final const
|
parseNode | Reads the content of a YAML node. An instance of Serializer.YamlStream.Parser... |
final const
|
parseSequence | Reads the content of a YAML sequence. An instance of Serializer.YamlStream.Pa... |
final const
|
parseSingleQuotedString | Reads the content of a YAML single quoted string. An instance of Serializer.Y... |
final const
|
parseStream | Begins the parsing of the stream. Returns an instance of Serializer.YamlStrea... |
final const
|
parseUnquotedString | Reads the content of a YAML unquoted string. An instance of Serializer.YamlSt... |
final const
|
readUntil | Reads data from the stream until delim is found, and returns it. The read ind... |
final |
stream | Internal stream object. |
final const
|
yamlToScalar | Converts an identifier to an instance of Serializer.YamlStream.Parser.Seriali... |
This class represents a YAML tag. The tag property identifies the type
of the native data structure presented by the node. A tag is denoted by the
! indicator.
Default available tags are null, bool, int, float, str, map,
seq, binary and timestamp.
| Modifiers | Member | Description |
|---|---|---|
class |
InvalidTag | This class provides the context of an invalid tag exception. |
const |
convert | Returns the data of the value identified identifier converted using the descr... |
const |
getName | Returns the name of the tag. |
const |
new | Creates a new tag property for the type described by type. If the type parame... |
@ const
|
registerType | Register a custom tag name identified by type_name. The converter must be a f... |
const |
toString | Returns the string representation of the tag. |
| Modifiers | Member | Description |
|---|---|---|
@ |
g_converters | Internal conversion functions. |
final |
name | Internal type name. |
This class provides the context of an invalid tag exception.
| Modifiers | Member | Description |
|---|---|---|
const |
getTag | Returns the tag that raised the error. |
const |
new | Create a new instance of the exception for the given tag. |
const |
toString | Returns the exception informations as a string. |
| Modifiers | Member | Description |
|---|---|---|
final |
tag | Internal tag. |
''
Internal anchor.
def (const self)
Returns the data of the referenced node.
null
Internal document.
def (self, document, anchor)
Creates a new alias node. The document parameter must be the instance
of Serializer.YamlDocument that contains the anchor. The anchor
parameter must be the anchor used by the alias.
def (const self)
Returns the referenced node.
def (const self)
Returns the string representation of the alias.
''
Internal content text.
def (self, content)
Creates a new comment for the content described by content.
If the content parameter is an instance of Serializer.YamlComment,
this instance is returned; otherwise content is cast to string to get
the text of the comment.
def (const self, level = 0)
Returns the string representation of the comment.
none
Internal comment.
def (const self)
Returns the comment associated to the directive or none if no comment
were specified.
def (const self)
Returns the name of the directive.
def (const self)
Returns the parameters sequence of the directive.
''
Internal directive name.
def (self, name, parameters)
Creates a new directive with the given name name and parameters
parameters sequence.
[]
Internal parameters set.
def (self, comment)
Sets the comment associated to the directive.
def (const self)
Returns the string representation of the processing instruction.
{}
Internal aliases.
def (self, node)
Appends node at the end of the document.
[]
Internal comment.
def (const self)
Returns the content of the document as a sequence of hashes and arrays corresponding to the YAML mappings and sequences.
def (const self, anchor)
Returns the alias target of the anchor anchor.
def (const self)
Returns the root node of the document.
def (const self)
Returns true if the document is empty; otherwise returns false.
def (self, node)
Removes node from the document.
none
Internal root node.
def (self, anchor, node)
Sets the alias target of the anchor anchor to node.
def (self, node)
Sets the root node of the document.
def (const self)
Returns the string representation of the document.
{}
Internal child node mapping.
def (self)
Resets the mapping.
def (const self)
Returns the content of the mapping as a sequence of hashes and arrays corresponding to the YAML mappings and sequences.
def (const self, const key)
Returns true if the mapping contains key; otherwise returns
false.
def (const self)
Returns an iterator on each elements in the mapping.
def (self, key, node)
Inserts the node node with the key given by key. If key is
already contained in the mapping, the associated value is updated.
def (const self)
Returns true if the mapping is empty; otherwise returns false.
def (self)
Creates a new empty mapping node.
def (self, content)
Creates a new mapping node for the mapping given by content.
def (self, key)
Removes key and the associated value from the document.
def (const self)
Returns the number of elements in the mapping.
def (const self)
Returns the content of the mapping as a sequence of hashes and arrays corresponding to the YAML mappings and sequences.
def (const self, level = 0)
Returns the string representation of the mapping for the indentation
level given by level.
def (const self, const other)
Returns false if other is the same node than self; otherwise
returns true.
def (const self, const other)
Returns true if other is the same node than self; otherwise returns
false.
def (const self)
Returns the content of the scalar as an instance of string, number,
boolean, System.Date or null corresponding to the YAML value. If an
instance of Serializer.YamlTag is associated to the node, this instance is used
to convert the value to the expected type.
def (const self)
Returns the Serializer.YamlTag of the node.
def (self)
Creates a new empty scalar node.
def (self, value, tag = none)
Creates a new scalar node for the value given by value. If tag is a
valid Serializer.YamlTag instance, this tag is used to convert the value
to the expected type.
def (const self, tag)
Sets the Serializer.YamlTag of the node.
none
Internal tag.
def (const self)
Returns the string representation of the scalar in its canonical form.
def (const self)
Returns the string representation of the scalar.
none
Internal value.
def (self, node)
Appends node at the end of the sequence.
[]
Internal child node sequence.
def (self)
Resets the sequence.
def (const self)
Returns the content of the sequence as a sequence of hashes and arrays corresponding to the YAML mappings and sequences.
def (const self, const node)
Returns true if the sequence contains node; otherwise returns
false.
def (const self)
Returns an iterator on each nodes of the sequence.
def (const self, node)
Returns the index of the node node if contained in the sequence;
otherwise returns none. Searching forward from index position 0.
def (const self, node, from)
Returns the index of the node node if contained in the sequence;
otherwise returns none. Searching forward from index position from.
def (self, index, node)
Inserts the node node at the index given by index. If index is
negative, the position is relative to the end of the sequence.
def (const self)
Returns true if the sequence is empty; otherwise returns false.
def (const self, node)
Returns the index of the node node if contained in the sequence;
otherwise returns none. Searching backward from the end of the
sequence.
def (const self, node, from)
Returns the index of the node node if contained in the sequence;
otherwise returns none. Searching backward from index position from.
def (self)
Creates a new empty sequence node.
def (self, content)
Creates a new sequence node for the sequence given by content.
def (self, node)
Removes node from the sequence.
def (const self)
Returns the number of nodes in the sequence.
def (const self)
Returns the content of the sequence as a sequence of hashes and arrays corresponding to the YAML mappings and sequences.
def (const self, level = 0)
Returns the string representation of the sequence for the indentation
level given by level.
def (self, data)
Writes the content of data to the stream using the write
function, then returns a reference to the stream.
def (self, data)
Reads an object from the stream and stores it in data, then returns a
reference to the stream.
none
Internal last read character.
def (self)
Discards the last token that was read. The same token will then be returned by the next call to nextToken.
false
Internal discarded state.
none
Internal current document node.
def (const self)
Returns the input stream current column number.
def (const self)
Returns the input stream current line number.
def (self, stream)
Creates a new parser on the stream given by stream.
def (self)
Returns the next character of the stream.
def (self)
Returns the next token of the stream. A token is a character that does
not match the /\s/ regex.
def (self)
Returns an instance of Serializer.YamlDocument corresponding to the
next YAML document in the stream or none if no more document is
available.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self, token, level, keep_newline, keep_extra_newline, chomp_extra_newline)
Reads the content of a YAML block string.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self, token)
Reads the content of a document. Returns an instance of
Serializer.YamlDocument corresponding to the YAML document or
none if no document is available.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self)
Reads the content of a YAML double quoted string.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self, inserter)
Reads the content of a YAML inline mapping.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self, inserter)
Reads the content of a YAML inline sequence.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self, identifier, level, inserter)
Reads the content of a YAML mapping.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self, token, level, inserter, mapping)
Reads the content of a YAML merged mapping.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self, token, level, inserter)
Reads the content of a new line.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self, token, level, inserter)
Reads the content of a YAML node.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self, level, inserter)
Reads the content of a YAML sequence.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self)
Reads the content of a YAML single quoted string.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self)
Begins the parsing of the stream. Returns an instance of
Serializer.YamlDirective corresponding to the next directive or an
instance of Serializer.YamlDocument corresponding to the next YAML
document in the stream or none if no more document is available.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self, token, level)
Reads the content of a YAML unquoted string.
An instance of Serializer.DocumentStream.InvalidDocument is raised on error.
def (self, delim)
Reads data from the stream until delim is found, and returns it.
The read index of the stream is then moved to the first character
identified by delim.
null
Internal stream object.
def (self, identifier, tag = none)
Converts an identifier to an instance of Serializer.YamlScalar.
def (self)
Reads the content of the stream and return it as an instance of Serializer.YamlDocument. If the content of the stream is not a valid YAML, an instance of Serializer.DocumentStream.InvalidDocument is raised.
def (self, data)
Writes the content of data to the stream.
def (const self)
Returns the tag that raised the error.
def (self, tag)
Create a new instance of the exception for the given tag.
null
Internal tag.
def (const self)
Returns the exception informations as a string.
def (self, identifier)
Returns the data of the value identified identifier converted using
the described type. If the described type is not a valid YAML type, an
instance of Serializer.YamlTag.InvalidTag is raised.
none
Internal conversion functions.
def (const self)
Returns the name of the tag.
''
Internal type name.
def (self, type)
Creates a new tag property for the type described by type.
If the type parameter is an instance of Serializer.YamlTag, this
instance is returned; otherwise type is cast to string to get the type
name.
def (type_name, converter)
Register a custom tag name identified by type_name. The converter
must be a function taking one string parameter to convert it into target
data type.
def (const self)
Returns the string representation of the tag.
- 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