doc: Further documentation
iterators.md: Adds a Ruby example iteration, a line to the C-style fashioned C++ example and a sentence stating that metakeys can be iterated in a similar fashion as long it is a KeySet.
@@ -68,6 +68,8 @@ within the loop-header or explicitely after changing the `KeySet`, e.g. by delet
That should be all you need for iterating over keys.
For future releases, the function `ksAtCursor` will be renamed to `ksAt`. (see issue #3976)
+You can iterate over metakeys in a similar fashion as long as you iterate over a `KeySet`, e.g., `keyMeta("my_meta_key")` returns a `KeySet` of metakeys.
+
The following is a comprehension of how to use iterators in various languages.
### C
@@ -88,6 +90,7 @@ C-style fashioned loop:
for (elektraCursor it = 0; it < ks.size (); ++it)
{
Key key = ks.at(it);
+ // ...
}
```
@@ -121,3 +124,11 @@ if size > 0 then
end
end
```
+
+### Ruby
+
+```ruby
+keySet.each do |key|
+ # ...
+end
+```
