summaryrefslogtreecommitdiff
path: root/vala/valasymbol.vala
diff options
context:
space:
mode:
authorEvan Nemerson <evan@coeus-group.com>2010-09-06 15:40:03 -0700
committerJürg Billeter <j@bitron.ch>2010-09-15 23:03:44 +0200
commitc87a98a7de58ac85d8ee742b6680104b78e8dc4c (patch)
tree5f07cb33b806c6b6d1c98343b7a384dc4e287e38 /vala/valasymbol.vala
parent288baf24219ed0e3ad7f15b44ef7b2369bb80c74 (diff)
downloadvala-c87a98a7de58ac85d8ee742b6680104b78e8dc4c.tar.gz
Write GIR version 1.2 instead of version 1.1
Fixes bug 628927.
Diffstat (limited to 'vala/valasymbol.vala')
-rw-r--r--vala/valasymbol.vala40
1 files changed, 39 insertions, 1 deletions
diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala
index 726d4c28b..e65717be8 100644
--- a/vala/valasymbol.vala
+++ b/vala/valasymbol.vala
@@ -51,7 +51,19 @@ public abstract class Vala.Symbol : CodeNode {
_scope.parent_scope = value;
}
}
-
+
+ /**
+ * The GIR name.
+ */
+ public string? gir_name {
+ get {
+ return _gir_name == null ? name : _gir_name;
+ }
+ set {
+ _gir_name = value;
+ }
+ }
+
/**
* The symbol name.
*/
@@ -185,6 +197,7 @@ public abstract class Vala.Symbol : CodeNode {
private weak Scope _owner;
private Scope _scope;
+ private string? _gir_name = null;
public Symbol (string? name, SourceReference? source_reference, Comment? comment = null) {
this.name = name;
@@ -194,6 +207,31 @@ public abstract class Vala.Symbol : CodeNode {
}
/**
+ * Returns the fully expanded GIR name of this symbol
+ *
+ * @return full GIR name
+ */
+ public string get_full_gir_name () {
+ if (parent_symbol == null) {
+ return gir_name;
+ }
+
+ if (name == null) {
+ return parent_symbol.get_full_gir_name ();
+ }
+
+ if (parent_symbol.get_full_gir_name () == null) {
+ return gir_name;
+ }
+
+ if (name.has_prefix (".")) {
+ return "%s%s".printf (parent_symbol.get_full_gir_name (), gir_name);
+ } else {
+ return "%s.%s".printf (parent_symbol.get_full_gir_name (), gir_name);
+ }
+ }
+
+ /**
* Returns the fully expanded name of this symbol for use in
* human-readable messages.
*