Felix Berlakovich
2014-07-06 19:11:35 UTC
Hi!
Question 1:
I recently stumbled upon the following issue:
I have a Key with MetaKeys below "conflict/". For example the Key has the following MetaKeys:
conflict/operation/our
conflict/operation/their
...
Now I need to find all the MetaKeys below "conflict/". The easiest way would be to use Key ("conflict").isBelow(currentMetaKey). Unfortunately this is not possible because the Key creation does not allow Keys with a name prefix other than "user" or "system". Is there any feasible workaround to reuse the methods of Key for arbitrary named MetaKeys? At the moment I use something like currentMeta.getFullName().find("conflict/") == 0, but this is definitely just an ugly workaround.
Related question 2:
I think the use of isBelow is not very intuitive. I think the isBelow property should refer to the key on which it is called instead of the passed argument. For example:
Key ("user/config/key/below").isBelow (Key ("user/config")) == true
Key ("user/config/key/below").isBelow (Key ("user/config/key/below/deeper")) == false
This way the call could be read as an English sentence. Nonetheless this interface would not any longer mirror the parameter order of the C interface.
Regards,
Felix
Question 1:
I recently stumbled upon the following issue:
I have a Key with MetaKeys below "conflict/". For example the Key has the following MetaKeys:
conflict/operation/our
conflict/operation/their
...
Now I need to find all the MetaKeys below "conflict/". The easiest way would be to use Key ("conflict").isBelow(currentMetaKey). Unfortunately this is not possible because the Key creation does not allow Keys with a name prefix other than "user" or "system". Is there any feasible workaround to reuse the methods of Key for arbitrary named MetaKeys? At the moment I use something like currentMeta.getFullName().find("conflict/") == 0, but this is definitely just an ugly workaround.
Related question 2:
I think the use of isBelow is not very intuitive. I think the isBelow property should refer to the key on which it is called instead of the passed argument. For example:
Key ("user/config/key/below").isBelow (Key ("user/config")) == true
Key ("user/config/key/below").isBelow (Key ("user/config/key/below/deeper")) == false
This way the call could be read as an English sentence. Nonetheless this interface would not any longer mirror the parameter order of the C interface.
Regards,
Felix