Exemplo n.º 1
0
        public ParsedFunctionSignature(Function f, ITypePrinter2 typePrinter)
        {
            TypePrinter = typePrinter;
            if (f.IsOperator || f.IsThisCall)
            {
                throw new ArgumentException("Unsupported function type", nameof(f));
            }

            Signature  = f.FunctionType.Type as FunctionType;
            Comments   = new ParsedComment(f);
            Name       = f.Name;
            Attributes = f.Attributes;
            Introducer = "public static extern ";
        }
Exemplo n.º 2
0
        public ParsedFunctionSignature(TypedefNameDecl td, ITypePrinter2 typePrinter)
        {
            TypePrinter = typePrinter;
            if (td.TryGetFunctionSignature(out FunctionType signature))
            {
                if (signature.CallingConvention != CppSharp.AST.CallingConvention.C)
                {
                    throw new NotSupportedException("Only delegates with the 'C' Calling convention are supported");
                }

                Signature  = signature;
                Comments   = new ParsedComment(td);
                Name       = td.Name;
                Attributes = new[] { UnmanagedFunctionPointerAttrib };
                Introducer = "public delegate ";
            }
            else
            {
                throw new ArgumentException("pointer to function type required");
            }
        }
 public LibLlvmTemplateFactory(IGeneratorConfig config, ITypePrinter2 typePrinter)
 {
     HandleToTemplateMap = config.BuildTemplateMap( );
     TypePrinter         = typePrinter;
 }
 public ExternalDocXmlTemplate(TranslationUnit tu, ITypePrinter2 typePrinter)
 {
     Unit        = tu;
     TypePrinter = typePrinter;
 }
Exemplo n.º 5
0
 public PerHeaderInteropTemplate(TranslationUnit tu, ITypePrinter2 typePrinter)
 {
     Unit        = tu;
     TypePrinter = typePrinter;
 }