[vala/switch-to-gir: 29/37] girparser: Add out/ref arguments



commit 504cc64bfeb08ce8bc482c6127771e76ff93ab24
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun Aug 29 15:35:12 2010 +0200

    girparser: Add out/ref arguments

 vala/valagirparser.vala |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 890f66d..964e4f0 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1533,7 +1533,18 @@ public class Vala.GirParser : CodeVisitor {
 		if (name == null) {
 			name = default_name;
 		}
-		string direction = reader.get_attribute ("direction");
+		string direction = null;
+		if (metadata.has_argument (ArgumentType.OUT)) {
+			if (metadata.get_bool (ArgumentType.OUT)) {
+				direction = "out";
+			} // null otherwise
+		} else if (metadata.has_argument (ArgumentType.REF)) {
+			if (metadata.get_bool (ArgumentType.REF)) {
+				direction = "inout";
+			} // null otherwise
+		} else {
+			direction = reader.get_attribute ("direction");
+		}
 		string transfer = reader.get_attribute ("transfer-ownership");
 		string allow_none = reader.get_attribute ("allow-none");
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]