1
|
1 /**
|
|
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
|
|
3 * Authors: Jacob Carlborg
|
|
4 * Version: Initial created: May 16, 2009
|
|
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
|
|
6 */
|
|
7 module dstep.objc.bridge.Type;
|
|
8
|
|
9 version (Tango)
|
|
10 import tango.core.Tuple;
|
|
11
|
|
12 else
|
|
13 import std.typetuple;
|
|
14
|
|
15 import dstep.objc.objc;
|
|
16
|
|
17 template ObjcTypeTuple (TList...)
|
|
18 {
|
|
19 alias replaceClasses!(TList).types ObjcTypeTuple;
|
|
20 }
|
|
21
|
|
22 private struct Wrap (TList...)
|
|
23 {
|
|
24 TList types;
|
|
25 }
|
|
26
|
|
27 private Wrap!(TList) replaceClasses (TList...) ()
|
|
28 {
|
|
29 alias Tuple!(TList) Types;
|
|
30
|
|
31 foreach (ref type ; Types)
|
|
32 static if (is(type == class))
|
|
33 type = id;
|
|
34
|
|
35 return Wrap!(Types);
|
|
36 } |