Make a Go Interface instead of a struct for top level objects.

Use a new struct Id as a concrete version of that type.
This commit is contained in:
gmp
2019-04-29 11:46:48 -04:00
parent c0c17e88d1
commit c03e37bd54
8 changed files with 94 additions and 19 deletions
+16
View File
@@ -0,0 +1,16 @@
package main
import (
"fmt"
"gitlab.wow.st/gmp/nswrap/examples/foundation/ns"
)
func main() {
n1 := ns.StringWithUTF8String(ns.CharFromString("hi there"))
c1 := n1.CapitalizedString()
gs := c1.UTF8String().String()
fmt.Println(gs)
a := ns.ArrayWithObjects(n1)
_ = a
}
+6
View File
@@ -18,5 +18,11 @@ struct stru {int a,b;};
- (int) hi2:(struct stru*)in;
- (struct stru) nstru1;
- (struct stru*) nstru2;
- (void) hi:(id)in;
- (void) hi3:(id)in;
@end
@interface ClassTwo : ClassOne
{ }
- (ClassTwo*) init;
@end
+14 -1
View File
@@ -54,6 +54,19 @@
ret->b = 10;
return ret;
}
- (void) hi:(id)in
{
NSLog(@"hi");
}
- (void) hi3:(id)in
{
NSLog(@"hi");
}
@end
@implementation ClassTwo
- (ClassTwo*) init
{
return [super init];
}
@end
+1 -1
View File
@@ -1,4 +1,4 @@
Package = "ClassOne"
InputFiles = [ "ClassOne/simple.h" ]
Classes = [ "ClassOne" ]
Classes = [ "ClassOne","ClassTwo" ]
Imports = [ "simple.h" ]