@@ -23,6 +23,9 @@ public class CSharpToCppTransformer : Transformer
23
23
// Platform.Collections.Methods.Lists
24
24
// Platform::Collections::Methods::Lists
25
25
( new Regex ( @"(namespace[^\r\n]+?)\.([^\r\n]+?)" ) , "$1::$2" , null , 20 ) ,
26
+ // out TProduct
27
+ // TProduct
28
+ ( new Regex ( @"(?<before>(<|, ))(in|out) (?<typeParameter>[a-zA-Z0-9]+)(?<after>(>|,))" ) , "${before}${typeParameter}${after}" , null , 10 ) ,
26
29
// public abstract class
27
30
// class
28
31
( new Regex ( @"(public abstract|static) class" ) , "class" , null , 0 ) ,
@@ -35,6 +38,12 @@ public class CSharpToCppTransformer : Transformer
35
38
// static void TestMultipleCreationsAndDeletions<TElement>(SizedBinaryTreeMethodsBase<TElement> tree, TElement* root)
36
39
// template<typename T> static void TestMultipleCreationsAndDeletions<TElement>(SizedBinaryTreeMethodsBase<TElement> tree, TElement* root)
37
40
( new Regex ( @"static ([a-zA-Z0-9]+) ([a-zA-Z0-9]+)<([a-zA-Z0-9]+)>\(([^\)]+)\)" ) , "template <typename $3> static $1 $2($4)" , null , 0 ) ,
41
+ // interface IFactory<out TProduct> {
42
+ // template <typename TProduct> class IFactory { public:
43
+ ( new Regex ( @"interface (?<interface>[a-zA-Z0-9]+)<(?<typeParameters>[a-zA-Z0-9 ,]+)>(?<whitespace>[^{]+){" ) , "template <typename ${typeParameters}> class ${interface}${whitespace}{" + Environment . NewLine + " public:" , null , 0 ) ,
44
+ // template <typename TObject, TProperty, TValue>
45
+ // template <typename TObject, typename TProperty, TValue>
46
+ ( new Regex ( @"(?<before>template <((, )?typename [a-zA-Z0-9]+)+, )(?<typeParameter>[a-zA-Z0-9]+)(?<after>(,|>))" ) , "${before}typename ${typeParameter}${after}" , null , 10 ) ,
38
47
// (this
39
48
// (
40
49
( new Regex ( @"\(this " ) , "(" , null , 0 ) ,
@@ -53,6 +62,9 @@ public class CSharpToCppTransformer : Transformer
53
62
// protected abstract TElement GetFirst();
54
63
// virtual TElement GetFirst() = 0;
55
64
( new Regex ( @"protected abstract ([^;]+);" ) , "virtual $1 = 0;" , null , 0 ) ,
65
+ // protected abstract TElement GetFirst();
66
+ // virtual TElement GetFirst() = 0;
67
+ ( new Regex ( @"([a-zA-Z0-9]+ [a-zA-Z0-9]+\([^\)]*\));" ) , "virtual $1 = 0;" , null , 0 ) ,
56
68
// public virtual
57
69
// virtual
58
70
( new Regex ( @"public virtual" ) , "virtual" , null , 0 ) ,
@@ -128,6 +140,9 @@ public class CSharpToCppTransformer : Transformer
128
140
// class SizedBinaryTreeMethodsBase : GenericCollectionMethodsBase
129
141
// class SizedBinaryTreeMethodsBase : public GenericCollectionMethodsBase
130
142
( new Regex ( @"class ([a-zA-Z0-9]+) : ([a-zA-Z0-9]+)" ) , "class $1 : public $2" , null , 0 ) ,
143
+ // class IProperty : ISetter<TValue, TObject>, IProvider<TValue, TObject>
144
+ // class IProperty : public ISetter<TValue, TObject>, IProvider<TValue, TObject>
145
+ ( new Regex ( @"(?<before>class [a-zA-Z0-9]+ : ((public [a-zA-Z0-9]+(<[a-zA-Z0-9 ,]+>)?, )+)?)(?<inheritedType>(?!public)[a-zA-Z0-9]+(<[a-zA-Z0-9 ,]+>)?)(?<after>(, [a-zA-Z0-9]+(?!>)|[ \r\n]+))" ) , "${before}public ${inheritedType}${after}" , null , 10 ) ,
131
146
// Insert scope borders.
132
147
// ref TElement root
133
148
// ~!root!~ref TElement root
0 commit comments