[vala/switch-to-gir: 23/34] girparser: Add out/ref arguments



commit a116d76ad665f74acb501f238812346a531060f7
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 1bb081a..2fb13f0 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1540,7 +1540,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]