}
public string fqn() {
- return this.ns + this.name;
+ // not sure if fqn really is correct here...
+ //
+ return this.nodetype == "Class" || this.nodetype=="Interface"
+ ? this.name : (this.ns + this.name);
}
public void copyFrom(GirObject pcls, bool is_interface)
{
this.inherits.add(pcls.fqn());
+
+ var liter = pcls.inherits.list_iterator();
+ while(liter.next()) {
+ if (this.inherits.contains(liter.get())) {
+ continue;
+ }
+ this.inherits.add(liter.get());
+ }
+
+
var iter = pcls.methods.map_iterator();
while(iter.next()) {
if (null != this.methods.get(iter.get_key())) {
}
// is_arary / is_instance / is_varargs..
+
+
+ if (this.inherits.size > 0) {
+ r.set_array_member("inherits", this.toJSONArrayString(this.inherits));
+ }
if (this.implements.size > 0) {
- r.set_array_member("length", this.toJSONArrayString(this.implements));
+ r.set_array_member("implements", this.toJSONArrayString(this.implements));
}
if (this.params.size > 0) {
return generator.to_data(null);
}
-
-
+
public GirObject fetchByFqn(string fqn) {
//print("Searching (%s)%s for %s\n", this.nodetype, this.name, fqn);
var bits = fqn.split(".");
// look at includes..
var iter = g.includes.map_iterator();
while(iter.next()) {
+ // skip empty namespaces on include..?
+ if ( iter.get_key() == "") {
+ continue;
+ }
var ret = fqtypeLookup(type, iter.get_key());
if (ret != type) {
return ret;
}
- }
+ }
return type;
}
public static string guessDefaultValueForType(string type) {
- if (type.contains(".")) {
+ //print("guessDefaultValueForType: %s\n", type);
+ if (type.length < 1 || type.contains(".")) {
return "null";
}
switch(type) {
public void walk(Xml.Node* element, GirObject? parent)
{
var n = element->get_prop("name");
- if (n == null) {
- n = "";
+ // ignore null or c:include...
+ if (n == null || (element->ns->prefix != null && element->ns->prefix == "c")) {
+ n = "";
}
- //print(element->name + " (" + parent.name + "==>" + n +")\n");
+ //print("%s:%s (%s ==> %s\n", element->ns->prefix , element->name , parent.name , n);
switch (element->name) {
case "repository":
break;
break;
case "instance-parameter":
+ break;
+ // looks like this is the C first arg, that is ignored (as it is
+ // treated as 'this' )
var c = new GirObject("Param",n);
- c.gparent = parent;
- c.ns = this.ns;
+ c.gparent = parent;
+ c.ns = this.ns;
c.is_instance = true;
parent.params.add(c);
parent = c;