当前位置: 首页>>代码示例>>C#>>正文


C# Declaration.ExplicitlyIgnore方法代码示例

本文整理汇总了C#中Declaration.ExplicitlyIgnore方法的典型用法代码示例。如果您正苦于以下问题:C# Declaration.ExplicitlyIgnore方法的具体用法?C# Declaration.ExplicitlyIgnore怎么用?C# Declaration.ExplicitlyIgnore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Declaration的用法示例。


在下文中一共展示了Declaration.ExplicitlyIgnore方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VisitDeclaration

        public override bool VisitDeclaration(Declaration decl)
        {
            if (AlreadyVisited(decl))
                return false;

            if (decl.GenerationKind == GenerationKind.None)
                return true;

            if (!CheckDeclarationAccess(decl))
            {
                Log.Debug("Decl '{0}' was ignored due to invalid access",
                    decl.Name);
                decl.ExplicitlyIgnore();
                return true;
            }

            if (decl.IsDependent)
            {
                decl.ExplicitlyIgnore();
                Log.Debug("Decl '{0}' was ignored due to dependent context",
                    decl.Name);
                return true;
            }

            return true;
        }
开发者ID:nalkaro,项目名称:CppSharp,代码行数:26,代码来源:CheckIgnoredDecls.cs

示例2: VisitDeclaration

        public override bool VisitDeclaration(Declaration decl)
        {
            if (!base.VisitDeclaration(decl))
                return false;

            // Do not clean up namespace names since it can mess up with the
            // names of anonymous or the global namespace.
            if (decl is Namespace)
                return true;

            // types with empty names are assumed to be private
            if (decl is Class && string.IsNullOrWhiteSpace(decl.Name))
            {
                decl.Name = decl.Namespace.Name == "_" ? "__" : "_";
                decl.ExplicitlyIgnore();
                return true;
            }

            Function function = decl as Function;
            if ((function == null || !function.IsOperator) && !(decl is Enumeration))
                decl.Name = CheckName(decl.Name);

            StringHelpers.CleanupText(ref decl.DebugText);
            return true;
        }
开发者ID:daxiazh,项目名称:CppSharp,代码行数:25,代码来源:CleanInvalidDeclNamesPass.cs

示例3: VisitDeclaration

        public override bool VisitDeclaration(Declaration decl)
        {
            var options = Driver.Options;
            if (!options.CheckSymbols || options.IsCLIGenerator)
                return false;

            var mangledDecl = decl as IMangledDecl;
            var method = decl as Method;
            if (mangledDecl != null && !(method != null && (method.IsPure || method.IsSynthetized)) &&
                !VisitMangledDeclaration(mangledDecl))
            {
                decl.ExplicitlyIgnore();
                return false;
            }

            return base.VisitDeclaration(decl);
        }
开发者ID:xistoso,项目名称:CppSharp,代码行数:17,代码来源:FindSymbolsPass.cs

示例4: CheckIgnoreMacros

        void CheckIgnoreMacros(Declaration decl, IEnumerable<MacroExpansion> expansions)
        {
            if (expansions.Any(e => e.Text == Prefix + "_IGNORE" &&
                                    e.MacroLocation != MacroLocation.ClassBody &&
                                    e.MacroLocation != MacroLocation.FunctionBody &&
                                    e.MacroLocation != MacroLocation.FunctionParameters))
            {
                Log.Debug("Decl '{0}' was ignored due to ignore macro",
                    decl.Name);
                decl.ExplicitlyIgnore();
            }

            if (expansions.Any(e => e.Text == Prefix + "_IGNORE_GEN" &&
                                    e.MacroLocation != MacroLocation.ClassBody &&
                                    e.MacroLocation != MacroLocation.FunctionBody &&
                                    e.MacroLocation != MacroLocation.FunctionParameters))
                decl.GenerationKind = GenerationKind.Internal;
        }
开发者ID:daxiazh,项目名称:CppSharp,代码行数:18,代码来源:CheckMacrosPass.cs

示例5: IgnorePrivateDeclaration

 private static void IgnorePrivateDeclaration(Declaration declaration)
 {
     if (declaration.Name != null &&
         (declaration.Name.StartsWith("Private", System.StringComparison.Ordinal) ||
          declaration.Name.EndsWith("Private", System.StringComparison.Ordinal)))
     {
         declaration.ExplicitlyIgnore();
     }
     else
     {
         DeclarationContext declarationContext = declaration as DeclarationContext;
         if (declarationContext != null)
         {
             IgnorePrivateDeclarations(declarationContext);
         }
     }
 }
开发者ID:grbd,项目名称:QtSharp,代码行数:17,代码来源:QtSharp.cs

示例6: VisitDeclaration

 public override bool VisitDeclaration(Declaration decl)
 {
     if (decl.Namespace != null && decl.TranslationUnit.IsSystemHeader)
         decl.ExplicitlyIgnore();
     return base.VisitDeclaration(decl);
 }
开发者ID:tritao,项目名称:CppSharp,代码行数:6,代码来源:IgnoreSystemDeclarationsPass.cs


注:本文中的Declaration.ExplicitlyIgnore方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。