Tools and libraries to glue C/C++ APIs to high-level languages
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

37 lines
1.1 KiB

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.GenerateCopyConstructors = true;
driver.Options.MarshalCharAsManagedChar = true;
driver.Options.GenerateProperties = true;
driver.Options.GenerateConversionOperators = 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));
}
}
}