private void GenerateInclude(ASTRecord <Declaration> record) { var decl = record.Value; if (decl.Namespace == null) { return; } var typedefType = record.Value as TypedefNameDecl; // Find a type map for the declaration and use it if it exists. TypeMap typeMap; if (TypeMapDatabase.FindTypeMap(record.Value, out typeMap) || (typedefType != null && TypeMapDatabase.FindTypeMap(typedefType.Type.Desugar(), out typeMap))) { typeMap.CLITypeReference(this, record); return; } var typeRef = GetTypeReference(decl); if (typeRef != null) { typeRef.Include.InHeader |= IsIncludeInHeader(record); } }
private bool IsIncludeInHeader(ASTRecord <Declaration> record) { if (TranslationUnit == record.Value.Namespace.TranslationUnit) { return(false); } return(record.IsBaseClass() || record.IsFieldValueType()); }
private bool IsIncludeInHeader(ASTRecord <Declaration> record) { if (TranslationUnit == record.Value.Namespace.TranslationUnit) { return(false); } return(true); }
public bool IsIncludeInHeader(ASTRecord <Declaration> record) { if (TranslationUnit == record.Value.Namespace.TranslationUnit) { return(false); } return(record.IsBaseClass() || record.IsFieldValueType() || record.IsDelegate() || record.IsEnumNestedInClass() || record.FunctionReturnsClassByValue()); }
private void GenerateInclude(ASTRecord <Declaration> record) { var decl = record.Value; if (decl.Namespace == null) { return; } // Find a type map for the declaration and use it if it exists. TypeMap typeMap; if (TypeMapDatabase.FindTypeMap(record.Value, out typeMap)) { typeMap.Declaration = record.Value; typeMap.CLITypeReference(this, record); return; } var translationUnit = decl.Namespace.TranslationUnit; if (translationUnit.IsSystemHeader) { return; } if (!decl.IsGenerated) { return; } if (IsBuiltinTypedef(decl)) { return; } var typeRef = GetTypeReference(decl); if (typeRef.Include.TranslationUnit == null) { typeRef.Include = new Include { File = GetIncludePath(translationUnit), TranslationUnit = translationUnit, Kind = translationUnit.IsGenerated ? Include.IncludeKind.Quoted : Include.IncludeKind.Angled, }; } typeRef.Include.InHeader |= IsIncludeInHeader(record); }
public override void CLITypeReference(CLITypeReferenceCollector collector, ASTRecord<Declaration> loc) { var typeRef = collector.GetTypeReference(loc.Value); var include = new Include { File = "cstddef", Kind = Include.IncludeKind.Angled, }; typeRef.Include = include; }
public override void CLITypeReference(CLITypeReferenceCollector collector, ASTRecord <Declaration> loc) { var typeRef = collector.GetTypeReference(loc.Value); var include = new CInclude { File = "cstddef", Kind = CInclude.IncludeKind.Angled, }; typeRef.Include = include; }
private void ProcessTypeMap(ASTRecord <Declaration> record) { TypeMap typeMap; if (!TypeMapDatabase.FindTypeMap(record.Value, out typeMap)) { return; } // Typemap must explicitly set the include file when one is required. GetTypeReference(record.Value).Include.File = ""; typeMap.Declaration = record.Value; typeMap.CLITypeReference(this, record); }
private void GenerateInclude(ASTRecord <Declaration> record) { var decl = record.Value; if (decl.Namespace == null) { return; } var declFile = decl.Namespace.TranslationUnit.FileName; if (decl.Namespace.TranslationUnit.IsSystemHeader) { return; } if (decl.Ignore) { return; } if (IsBuiltinTypedef(decl)) { return; } if (declFile.Contains("String")) { return; } var typeRef = GetTypeReference(decl); typeRef.Include = new Include() { File = declFile, TranslationUnit = decl.Namespace.TranslationUnit, Kind = Include.IncludeKind.Quoted, InHeader = IsIncludeInHeader(record) }; }
public override void CLITypeReference(CLITypeReferenceCollector collector, ASTRecord <Declaration> loc) { if (!(Declaration is ClassTemplate)) { return; } var typeRef = collector.GetTypeReference(Declaration); typeRef.Include = new Include() { File = "ResourceHandle.h", Kind = Include.IncludeKind.Quoted, InHeader = true }; Debug.Assert(loc.Parent != null); var type = loc.Parent.Object as CppSharp.AST.Type; var templateType = type.Desugar() as TemplateSpecializationType; var tag = templateType.Arguments[0].Type.Type as TagType; if (tag == null) { return; // TODO Fix this } var argDecl = tag.Declaration; var argTypeDef = collector.GetTypeReference(argDecl); argTypeDef.Include = new Include() { File = argDecl.Namespace.TranslationUnit.FileName, Kind = Include.IncludeKind.Quoted, InHeader = true }; }
public override void CLITypeReference(CLITypeReferenceCollector collector, ASTRecord<Declaration> loc) { var typeRef = collector.GetTypeReference(Declaration); typeRef.Include = new Include() { File = "StringConverter.h", Kind = Include.IncludeKind.Quoted, InHeader = true }; }
public override void CLITypeReference(CLITypeReferenceCollector collector, ASTRecord<Declaration> loc) { if(!(Declaration is ClassTemplate)) return; var typeRef = collector.GetTypeReference(Declaration); typeRef.Include = new Include() { File = "ResourceHandle.h", Kind = Include.IncludeKind.Quoted, InHeader = true }; Debug.Assert(loc.Parent != null); var type = loc.Parent.Object as CppSharp.AST.Type; var templateType = type.Desugar() as TemplateSpecializationType; var tag = templateType.Arguments[0].Type.Type as TagType; if(tag == null) return; // TODO Fix this var argDecl = tag.Declaration; var argTypeDef = collector.GetTypeReference(argDecl); argTypeDef.Include = new Include() { File = argDecl.Namespace.TranslationUnit.FileName, Kind = Include.IncludeKind.Quoted, InHeader = true }; }
public virtual void CLITypeReference(CLITypeReferenceCollector collector, ASTRecord <Declaration> loc) { }
public virtual void CLITypeReference(CLITypeReferenceCollector collector, ASTRecord<Declaration> loc) { }
private void GenerateInclude(ASTRecord<Declaration> record) { var decl = record.Value; if(decl.Namespace == null) return; var declFile = decl.Namespace.TranslationUnit.FileName; if(decl.Namespace.TranslationUnit.IsSystemHeader) return; if(decl.Ignore) return; if(IsBuiltinTypedef(decl)) return; var typeRef = GetTypeReference(decl); typeRef.Include = new Include() { File = declFile, TranslationUnit = decl.Namespace.TranslationUnit, Kind = Include.IncludeKind.Quoted, InHeader = IsIncludeInHeader(record) }; }
private void GenerateInclude(ASTRecord<Declaration> record) { var decl = record.Value; if(decl.Namespace == null) return; // Find a type map for the declaration and use it if it exists. TypeMap typeMap; if (TypeMapDatabase.FindTypeMap(record.Value, out typeMap)) { typeMap.Declaration = record.Value; typeMap.CLITypeReference(this, record); return; } var translationUnit = decl.Namespace.TranslationUnit; if (translationUnit.IsSystemHeader) return; if (!decl.IsGenerated) return; if(IsBuiltinTypedef(decl)) return; var typeRef = GetTypeReference(decl); if (typeRef.Include.TranslationUnit == null) { typeRef.Include = new Include { File = GetIncludePath(translationUnit), TranslationUnit = translationUnit, Kind = translationUnit.IsGenerated ? Include.IncludeKind.Quoted : Include.IncludeKind.Angled, }; } typeRef.Include.InHeader |= IsIncludeInHeader(record); }
private bool IsIncludeInHeader(ASTRecord<Declaration> record) { if (TranslationUnit == record.Value.Namespace.TranslationUnit) return false; return record.IsBaseClass() || record.IsFieldValueType() || record.IsDelegate(); }
public virtual void CppTypeReference(CLITypeReference collector, ASTRecord <Declaration> record) { throw new NotImplementedException(); }
private void ProcessTypeMap(ASTRecord<Declaration> record) { TypeMap typeMap; if (!TypeMapDatabase.FindTypeMap(record.Value, out typeMap)) return; typeMap.Declaration = record.Value; typeMap.CLITypeReference(this, record); }