add getParent & getPath

This commit is contained in:
Valk Richard Li 2021-02-25 22:30:28 +08:00
parent 1c40cca673
commit 2e8208a752
1 changed files with 11 additions and 1 deletions

View File

@ -102,6 +102,15 @@ props.Node=
return k;
return '';
},
getParent:func()
{
return me.parent;
},
getPath:func()
{
if(me.parent==nil) return '';
return me.parent.getPath()~'/'~me.getName();
},
equals:func(node){return me==node;},
debug:func(s='')
{
@ -139,4 +148,5 @@ props.getNode('/test/in',0).setValue('/','true');
props.getNode('/test/in',1).setValue('/','false');
props.getNode('/test/in',2).setValue('/','welcome aboard,need help? use help->tutorial');
props.getNode('/test/in',3).setValue('/',2147483648);
props.globals.debug();
props.globals.debug();
println(props.getNode('/test/in',3).getPath());