Pyolian: add API to get file name of a unit
authorDave Andreoli <dave@gurumeditation.it>
Wed, 28 Feb 2018 12:36:49 +0000 (13:36 +0100)
committerWonki Kim <wonki_.kim@samsung.com>
Tue, 10 Apr 2018 11:10:43 +0000 (20:10 +0900)
src/scripts/pyolian/eolian.py
src/scripts/pyolian/eolian_lib.py

index 1660ded..6a5cdb0 100644 (file)
@@ -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
index d4fc9d9..5f45c0c 100644 (file)
@@ -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