mirror of https://github.com/mono/CppSharp.git
6 changed files with 0 additions and 120 deletions
@ -1,57 +0,0 @@ |
|||||||
using CppSharp.AST.Extensions; |
|
||||||
using CppSharp.Generators; |
|
||||||
using CppSharp.Generators.CLI; |
|
||||||
using CppSharp.Generators.CSharp; |
|
||||||
using CppSharp.Types; |
|
||||||
|
|
||||||
namespace TypeMaps.Gen |
|
||||||
{ |
|
||||||
[TypeMap("QList")] |
|
||||||
public class QList : TypeMap |
|
||||||
{ |
|
||||||
public override bool DoesMarshalling |
|
||||||
{ |
|
||||||
get { return false; } |
|
||||||
} |
|
||||||
|
|
||||||
public override string CLISignature(CLITypePrinterContext ctx) |
|
||||||
{ |
|
||||||
return "TypeMaps::QList^"; |
|
||||||
} |
|
||||||
|
|
||||||
public override void CLIMarshalToManaged(MarshalContext ctx) |
|
||||||
{ |
|
||||||
} |
|
||||||
|
|
||||||
public override void CLIMarshalToNative(MarshalContext ctx) |
|
||||||
{ |
|
||||||
} |
|
||||||
|
|
||||||
public override string CSharpSignature(CSharpTypePrinterContext ctx) |
|
||||||
{ |
|
||||||
if (ctx.CSharpKind == CSharpTypePrinterContextKind.Native) |
|
||||||
{ |
|
||||||
if (Type.IsAddress()) |
|
||||||
{ |
|
||||||
return "QList.Internal*"; |
|
||||||
} |
|
||||||
return "QList.Internal"; |
|
||||||
} |
|
||||||
return "QList"; |
|
||||||
} |
|
||||||
|
|
||||||
public override void CSharpMarshalToManaged(MarshalContext ctx) |
|
||||||
{ |
|
||||||
} |
|
||||||
|
|
||||||
public override void CSharpMarshalToNative(MarshalContext ctx) |
|
||||||
{ |
|
||||||
} |
|
||||||
|
|
||||||
public override void CSharpMarshalCopyCtorToManaged(MarshalContext ctx) |
|
||||||
{ |
|
||||||
ctx.SupportBefore.WriteLine("var __instance = new {0}.Internal();", ctx.ReturnType); |
|
||||||
ctx.SupportBefore.WriteLine("__instance.i = {0}.i;", ctx.ReturnVarName); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,11 +0,0 @@ |
|||||||
#include "TypeMaps.h" |
|
||||||
#include <string.h> |
|
||||||
|
|
||||||
QList::QList() : i(5) |
|
||||||
{ |
|
||||||
} |
|
||||||
|
|
||||||
QList HasQList::getList() |
|
||||||
{ |
|
||||||
return list; |
|
||||||
} |
|
@ -1,34 +0,0 @@ |
|||||||
using System.Linq; |
|
||||||
using CppSharp.AST; |
|
||||||
using CppSharp.Generators; |
|
||||||
using CppSharp.Utils; |
|
||||||
|
|
||||||
namespace CppSharp.Tests |
|
||||||
{ |
|
||||||
public class TypeMaps : GeneratorTest |
|
||||||
{ |
|
||||||
public TypeMaps(GeneratorKind kind) |
|
||||||
: base("TypeMaps", kind) |
|
||||||
{ |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
public override void SetupPasses(Driver driver) |
|
||||||
{ |
|
||||||
driver.Options.MarshalCharAsManagedChar = true; |
|
||||||
} |
|
||||||
|
|
||||||
public override void Preprocess(Driver driver, ASTContext ctx) |
|
||||||
{ |
|
||||||
ctx.SetClassAsValueType("HasQList"); |
|
||||||
ctx.FindCompleteClass("QList").Constructors.First(c => c.IsCopyConstructor).GenerationKind = GenerationKind.None; |
|
||||||
ctx.IgnoreClassWithName("IgnoredType"); |
|
||||||
} |
|
||||||
|
|
||||||
public static void Main(string[] args) |
|
||||||
{ |
|
||||||
ConsoleDriver.Run(new TypeMaps(GeneratorKind.CLI)); |
|
||||||
ConsoleDriver.Run(new TypeMaps(GeneratorKind.CSharp)); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,16 +0,0 @@ |
|||||||
#include "../Tests.h" |
|
||||||
|
|
||||||
class DLL_API QList |
|
||||||
{ |
|
||||||
public: |
|
||||||
QList(); |
|
||||||
int i; |
|
||||||
}; |
|
||||||
|
|
||||||
class DLL_API HasQList |
|
||||||
{ |
|
||||||
public: |
|
||||||
QList getList(); |
|
||||||
private: |
|
||||||
QList list; |
|
||||||
}; |
|
Loading…
Reference in new issue