1
0
Fork 0

Expose SGPropertyNode::removeAllChildren() to Nasal.

This commit is contained in:
Thomas Geymayer 2013-12-07 13:47:10 +01:00
parent 5a1a1781e2
commit fcc6d3edc2

View file

@ -575,6 +575,15 @@ static naRef f_removeChildren(naContext c, naRef me, int argc, naRef* args)
return result; return result;
} }
// Remove all children of a property node.
// Forms:
// props.Node.removeAllChildren();
static naRef f_removeAllChildren(naContext c, naRef me, int argc, naRef* args)
{
NODENOARG();
node->removeAllChildren();
return propNodeGhostCreate(c, node);
}
// Alias this property to another one; returns 1 on success or 0 on failure // Alias this property to another one; returns 1 on success or 0 on failure
// (only applicable to tied properties). // (only applicable to tied properties).
@ -665,30 +674,31 @@ static struct {
naCFunction func; naCFunction func;
const char* name; const char* name;
} propfuncs[] = { } propfuncs[] = {
{ f_getType, "_getType" }, { f_getType, "_getType" },
{ f_getAttribute, "_getAttribute" }, { f_getAttribute, "_getAttribute" },
{ f_setAttribute, "_setAttribute" }, { f_setAttribute, "_setAttribute" },
{ f_getName, "_getName" }, { f_getName, "_getName" },
{ f_getIndex, "_getIndex" }, { f_getIndex, "_getIndex" },
{ f_equals, "_equals" }, { f_equals, "_equals" },
{ f_getValue, "_getValue" }, { f_getValue, "_getValue" },
{ f_setValue, "_setValue" }, { f_setValue, "_setValue" },
{ f_setIntValue, "_setIntValue" }, { f_setIntValue, "_setIntValue" },
{ f_setBoolValue, "_setBoolValue" }, { f_setBoolValue, "_setBoolValue" },
{ f_setDoubleValue, "_setDoubleValue" }, { f_setDoubleValue, "_setDoubleValue" },
{ f_getParent, "_getParent" }, { f_getParent, "_getParent" },
{ f_getChild, "_getChild" }, { f_getChild, "_getChild" },
{ f_getChildren, "_getChildren" }, { f_getChildren, "_getChildren" },
{ f_addChild, "_addChild" }, { f_addChild, "_addChild" },
{ f_addChildren, "_addChildren" }, { f_addChildren, "_addChildren" },
{ f_removeChild, "_removeChild" }, { f_removeChild, "_removeChild" },
{ f_removeChildren, "_removeChildren" }, { f_removeChildren, "_removeChildren" },
{ f_alias, "_alias" }, { f_removeAllChildren, "_removeAllChildren" },
{ f_unalias, "_unalias" }, { f_alias, "_alias" },
{ f_getAliasTarget, "_getAliasTarget" }, { f_unalias, "_unalias" },
{ f_getNode, "_getNode" }, { f_getAliasTarget, "_getAliasTarget" },
{ f_new, "_new" }, { f_getNode, "_getNode" },
{ f_globals, "_globals" }, { f_new, "_new" },
{ f_globals, "_globals" },
{ 0, 0 } { 0, 0 }
}; };