aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2018-02-28 13:36:49 +0100
committerDave Andreoli <dave@gurumeditation.it>2018-02-28 14:31:59 +0100
commitb7de65272f3cfbbad8fdd84cb6b5de1f2d196ba1 (patch)
treef3204f93aa2e36af905f89696906f7a827db41e5
parentPyolian: add API to get children of a unit (diff)
downloadefl-b7de65272f3cfbbad8fdd84cb6b5de1f2d196ba1.tar.gz
Pyolian: add API to get file name of a unit
-rw-r--r--src/scripts/pyolian/eolian.py4
-rw-r--r--src/scripts/pyolian/eolian_lib.py4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index 1660ded321..6a5cdb0cfe 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -337,6 +337,10 @@ class Eolian_Unit(EolianBaseObject):
def children(self):
return Iterator(Eolian_Unit, lib.eolian_unit_children_get(self._obj))
+ @property
+ def file(self):
+ return _str_to_py(lib.eolian_unit_file_get(self._obj))
+
def class_get_by_name(self, class_name):
c_cls = lib.eolian_class_get_by_name(self._obj, _str_to_bytes(class_name))
return Class(c_cls) if c_cls else None
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py
index d4fc9d92cb..5f45c0c73d 100644
--- a/src/scripts/pyolian/eolian_lib.py
+++ b/src/scripts/pyolian/eolian_lib.py
@@ -95,6 +95,10 @@ lib.eolian_declarations_get_by_file.restype = c_void_p
lib.eolian_unit_children_get.argtypes = [c_void_p,]
lib.eolian_unit_children_get.restype = c_void_p
+# EAPI const char *eolian_unit_file_get(const Eolian_Unit *unit);
+lib.eolian_unit_children_get.argtypes = [c_void_p,]
+lib.eolian_unit_children_get.restype = c_char_p
+
# EAPI const Eolian_Class *eolian_class_get_by_name(const Eolian_Unit *unit, const char *class_name);
lib.eolian_class_get_by_name.argtypes = [c_void_p, c_char_p]
lib.eolian_class_get_by_name.restype = c_void_p