summaryrefslogtreecommitdiffstats
path: root/DTContents.c
diff options
context:
space:
mode:
Diffstat (limited to 'DTContents.c')
-rw-r--r--DTContents.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/DTContents.c b/DTContents.c
new file mode 100644
index 0000000..cb49691
--- /dev/null
+++ b/DTContents.c
@@ -0,0 +1,16 @@
+#strict 2
+
+global func GetContents(bool recursive, object obj)
+{
+ obj = obj || this;
+ var ret = [];
+ for(var i = 0; i < obj->ContentsCount(); ++i)
+ {
+ ret[GetLength(ret)] = obj->Contents(i);
+ if(recursive)
+ {
+ ArrayAppendArray(ret, obj->Contents(i)->GetContents(true));
+ }
+ }
+ return ret;
+}