update readme
This commit is contained in:
parent
a3ba700140
commit
e98c7c070f
22
README.md
22
README.md
|
@ -8,7 +8,7 @@ So, currently the lib deal only with one yaml document (it's not recommended to
|
||||||
but you can use a special `^imports` clause (special mapping node) to load a subset of yaml files
|
but you can use a special `^imports` clause (special mapping node) to load a subset of yaml files
|
||||||
in the main yaml document.
|
in the main yaml document.
|
||||||
|
|
||||||
the lib does not manage yet tag directives and tag values.
|
the lib does not manage yet tag directives and tag values (planned).
|
||||||
**pluie-yaml** use the ![libyaml c library](https://github.com/yaml/libyaml) (License MIT, many thanks to Kirill Simonov) to parse and retriew related yaml events.
|
**pluie-yaml** use the ![libyaml c library](https://github.com/yaml/libyaml) (License MIT, many thanks to Kirill Simonov) to parse and retriew related yaml events.
|
||||||
|
|
||||||
![pluie-yaml](https://www.meta-tech.academy/img/pluie-yaml-imports2.png)
|
![pluie-yaml](https://www.meta-tech.academy/img/pluie-yaml-imports2.png)
|
||||||
|
@ -183,8 +183,11 @@ vala code :
|
||||||
```vala
|
```vala
|
||||||
var config = new Yaml.Config (path);
|
var config = new Yaml.Config (path);
|
||||||
var root = config.root_node ();
|
var root = config.root_node ();
|
||||||
foreach (var child in root) {
|
if (root != null && !root.empty ()) {
|
||||||
of.echo (child.to_string ());
|
foreach (var child in root) {
|
||||||
|
// do stuff
|
||||||
|
of.echo (child.to_string ());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -193,11 +196,14 @@ or
|
||||||
```vala
|
```vala
|
||||||
var config = new Yaml.Config (path);
|
var config = new Yaml.Config (path);
|
||||||
var root = config.root_node ();
|
var root = config.root_node ();
|
||||||
Iterator<Yaml.Node> it = root.iterator ();
|
if (root != null && root.count () > 0) {
|
||||||
Yaml.Node? child = null;
|
Iterator<Yaml.Node> it = root.iterator ();
|
||||||
for (var has_next = it.next (); has_next; has_next = it.next ()) {
|
Yaml.Node? child = null;
|
||||||
child = it.get ();
|
for (var has_next = it.next (); has_next; has_next = it.next ()) {
|
||||||
of.echo (child.to_string ());
|
child = it.get ();
|
||||||
|
// do stuff
|
||||||
|
of.echo (child.to_string ());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user