Beispiel #1
0
        public bool FindTypeMap(CppSharp.AST.Type type, out TypePrinterResult result)
        {
            result = null;

            if (!ResolveTypeMaps)
            {
                return(false);
            }

            TypeMap typeMap;

            if (!TypeMapDatabase.FindTypeMap(type, out typeMap) || typeMap.IsIgnored)
            {
                return(false);
            }

            var typePrinterContext = new TypePrinterContext
            {
                Type        = type,
                Kind        = Kind,
                MarshalKind = MarshalKind
            };

            var typePrinter = new CppTypePrinter(Context)
            {
                PrintFlavorKind     = PrintFlavorKind,
                ScopeKind           = ScopeKind,
                PrintTypeQualifiers = PrintTypeQualifiers,
                PrintTypeModifiers  = PrintTypeModifiers,
                ResolveTypeMaps     = false
            };

            typePrinter.PushContext(ContextKind);

            var typeName = typeMap.CppSignatureType(typePrinterContext).Visit(typePrinter);

            result = new TypePrinterResult(typeName)
            {
                TypeMap = typeMap
            };

            return(true);
        }
Beispiel #2
0
 public CGenerator(BindingContext context) : base(context)
 {
     typePrinter = new CppTypePrinter(Context);
 }