Example #1
0
        public override TypePrinterResult VisitTypedefType(TypedefType typedef,
                                                           TypeQualifiers quals)
        {
            var decl = typedef.Declaration;

            TypeMap typeMap = null;

            if (TypeMapDatabase.FindTypeMap(decl, out typeMap))
            {
                typeMap.Type = typedef;
                var typePrinterContext = new TypePrinterContext {
                    Type = typedef
                };
                return(typeMap.CLISignature(typePrinterContext));
            }

            FunctionType func;

            if (decl.Type.IsPointerTo <FunctionType>(out func))
            {
                // TODO: Use SafeIdentifier()
                return(string.Format("{0}^", VisitDeclaration(decl)));
            }

            return(decl.Type.Visit(this));
        }
Example #2
0
        public string VisitTemplateSpecializationType(TemplateSpecializationType template,
                                                      TypeQualifiers quals)
        {
            var decl = template.Template.TemplatedDecl;

            TypeMap typeMap = null;

            if (TypeMapDatabase.FindTypeMap(template, out typeMap))
            {
                typeMap.Declaration = decl;
                typeMap.Type        = template;
                Context.Type        = template;
                return(typeMap.CLISignature(Context));
            }

            return(decl.Name);
        }
Example #3
0
        public string VisitTagType(TagType tag, TypeQualifiers quals)
        {
            TypeMap typeMap = null;

            if (TypeMapDatabase.FindTypeMap(tag, out typeMap))
            {
                typeMap.Type = tag;
                Context.Type = tag;
                return(typeMap.CLISignature(Context));
            }

            Declaration decl = tag.Declaration;

            if (decl == null)
            {
                return(string.Empty);
            }

            return(VisitDeclaration(decl, quals));
        }
Example #4
0
        public override TypePrinterResult VisitTemplateSpecializationType(
            TemplateSpecializationType template, TypeQualifiers quals)
        {
            var decl = template.Template.TemplatedDecl;

            if (decl == null)
            {
                return(string.Empty);
            }

            TypeMap typeMap = null;

            if (TypeMapDatabase.FindTypeMap(template, out typeMap) && !typeMap.IsIgnored)
            {
                typeMap.Declaration     = decl;
                typeMap.Type            = template;
                TypePrinterContext.Type = template;
                return(typeMap.CLISignature(TypePrinterContext));
            }

            return(decl.Name);
        }
Example #5
0
        public override TypePrinterResult VisitTagType(TagType tag, TypeQualifiers quals)
        {
            TypeMap typeMap = null;

            if (TypeMapDatabase.FindTypeMap(tag, out typeMap))
            {
                typeMap.Type = tag;
                var typePrinterContext = new TypePrinterContext {
                    Type = tag
                };
                return(typeMap.CLISignature(typePrinterContext));
            }

            Declaration decl = tag.Declaration;

            if (decl == null)
            {
                return(string.Empty);
            }

            return(VisitDeclaration(decl, quals));
        }