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


C# ASTContext.SetClassAsValueType方法代码示例

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


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

示例1: Preprocess

 public override void Preprocess(Driver driver, ASTContext ctx)
 {
     ctx.SetClassAsValueType("Bar");
     ctx.SetClassAsValueType("Bar2");
     ctx.SetMethodParameterUsage("Hello", "TestPrimitiveOut", 1, ParameterUsage.Out);
     ctx.SetMethodParameterUsage("Hello", "TestPrimitiveOutRef", 1, ParameterUsage.Out);
 }
开发者ID:kidleon,项目名称:CppSharp,代码行数:7,代码来源:Basic.cs

示例2: Preprocess

 public override void Preprocess(Driver driver, ASTContext ctx)
 {
     driver.AddTranslationUnitPass(new GetterSetterToPropertyPass());
     driver.AddTranslationUnitPass(new CheckMacroPass());
     ctx.SetClassAsValueType("Bar");
     ctx.SetClassAsValueType("Bar2");
 }
开发者ID:nalkaro,项目名称:CppSharp,代码行数:7,代码来源:Basic.cs

示例3: Preprocess

 public void Preprocess(Driver driver, ASTContext lib)
 {
     string qtModule = "Qt" + this.module;
     string moduleIncludes = Path.Combine(this.includePath, qtModule);
     foreach (TranslationUnit unit in lib.TranslationUnits.Where(u => u.FilePath != "<invalid>"))
     {
         if (Path.GetDirectoryName(unit.FilePath) != moduleIncludes)
         {
             unit.ExplicityIgnored = true;
         }
         else
         {
             IgnorePrivateDeclarations(unit);
         }
     }
     lib.SetClassAsValueType("QByteArray");
     lib.SetClassAsValueType("QListData");
     lib.SetClassAsValueType("QListData::Data");
     lib.SetClassAsValueType("QLocale");
     lib.SetClassAsValueType("QModelIndex");
     lib.SetClassAsValueType("QPoint");
     lib.SetClassAsValueType("QPointF");
     lib.SetClassAsValueType("QSize");
     lib.SetClassAsValueType("QSizeF");
     lib.SetClassAsValueType("QRect");
     lib.SetClassAsValueType("QRectF");
     lib.SetClassAsValueType("QGenericArgument");
     lib.SetClassAsValueType("QVariant");
     // TODO: remove these when their symbols have been replaced or included
     lib.IgnoreClassMethodWithName("QXmlStreamReader", "attributes");
     lib.IgnoreClassMethodWithName("QTimeZone", "offsetData");
     lib.IgnoreClassMethodWithName("QTimeZone", "nextTransition");
     lib.IgnoreClassMethodWithName("QTimeZone", "previousTransition");
 }
开发者ID:RodolpheFouquet,项目名称:QtSharp,代码行数:34,代码来源:QtSharp.cs

示例4: Preprocess

        public void Preprocess(Driver driver, ASTContext lib)
        {
            lib.SetClassAsValueType("CppSharp::ParserOptions");
            lib.SetClassAsValueType("CppSharp::ParserDiagnostic");
            lib.SetClassAsValueType("CppSharp::ParserResult");

            lib.RenameNamespace("CppSharp::CppParser", "Parser");
        }
开发者ID:jijamw,项目名称:CppSharp,代码行数:8,代码来源:ParserGen.cs

示例5: Preprocess

        public override void Preprocess(Driver driver, ASTContext ctx)
        {
            ctx.SetClassAsValueType("TestCopyConstructorVal");
            ctx.SetClassAsValueType("QGenericArgument");
            ctx.SetClassAsValueType("StructWithPrivateFields");
            ctx.SetClassAsValueType("QSize");

            ctx.IgnoreClassWithName("IgnoredTypeInheritingNonIgnoredWithNoEmptyCtor");
        }
开发者ID:nalkaro,项目名称:CppSharp,代码行数:9,代码来源:CSharpTemp.cs

示例6: Preprocess

        public override void Preprocess(Driver driver, ASTContext ctx)
        {
            driver.AddTranslationUnitPass(new CheckMacroPass());
            ctx.SetClassAsValueType("Bar");
            ctx.SetClassAsValueType("Bar2");
            ctx.IgnoreClassWithName("IgnoredType");

            ctx.FindCompleteClass("Foo").Enums.First(
                e => string.IsNullOrEmpty(e.Name)).Name = "RenamedEmptyEnum";
        }
开发者ID:ddobrev,项目名称:CppSharp,代码行数:10,代码来源:Common.cs

示例7: Preprocess

 public override void Preprocess(Driver driver, ASTContext ctx)
 {
     driver.AddTranslationUnitPass(new GetterSetterToPropertyPass());
     ctx.SetClassAsValueType("Bar");
     ctx.SetClassAsValueType("Bar2");
     ctx.SetMethodParameterUsage("Hello", "TestPrimitiveOut", 1, ParameterUsage.Out);
     ctx.SetMethodParameterUsage("Hello", "TestPrimitiveOutRef", 1, ParameterUsage.Out);
     ctx.SetMethodParameterUsage("Hello", "TestPrimitiveInOut", 1, ParameterUsage.InOut);
     ctx.SetMethodParameterUsage("Hello", "TestPrimitiveInOutRef", 1, ParameterUsage.InOut);
     ctx.SetMethodParameterUsage("Hello", "EnumOut", 2, ParameterUsage.Out);
     ctx.SetMethodParameterUsage("Hello", "EnumOutRef", 2, ParameterUsage.Out);
 }
开发者ID:kitsilanosoftware,项目名称:CppSharp,代码行数:12,代码来源:Basic.cs

示例8: Preprocess

 public override void Preprocess(Driver driver, ASTContext ctx)
 {
     ctx.SetClassAsValueType("HasQList");
     ctx.FindCompleteClass("QList").Constructors.First(c => c.IsCopyConstructor).GenerationKind = GenerationKind.None;
     ctx.IgnoreClassWithName("IgnoredType");
 }
开发者ID:corefan,项目名称:CppSharp,代码行数:6,代码来源:TypeMaps.cs

示例9: Preprocess

 public override void Preprocess(Driver driver, ASTContext ctx)
 {
     ctx.SetClassAsValueType("TestCopyConstructorVal");
 }
开发者ID:kidleon,项目名称:CppSharp,代码行数:4,代码来源:CSharpTemp.cs

示例10: Preprocess

 public void Preprocess(Driver driver, ASTContext lib)
 {
     var qtModule = "Qt" + this.module;
     var moduleIncludes = Path.Combine(this.includePath, qtModule);
     foreach (var unit in lib.TranslationUnits.Where(u => u.FilePath != "<invalid>"))
     {
         if (Path.GetDirectoryName(unit.FilePath) != moduleIncludes)
         {
             LinkDeclaration(unit);
         }
         else
         {
             IgnorePrivateDeclarations(unit);
         }
     }
     lib.SetClassAsValueType("QByteArray");
     lib.SetClassAsValueType("QListData");
     lib.SetClassAsValueType("QListData::Data");
     lib.SetClassAsValueType("QLocale");
     lib.SetClassAsValueType("QModelIndex");
     lib.SetClassAsValueType("QPoint");
     lib.SetClassAsValueType("QPointF");
     lib.SetClassAsValueType("QSize");
     lib.SetClassAsValueType("QSizeF");
     lib.SetClassAsValueType("QRect");
     lib.SetClassAsValueType("QRectF");
     lib.SetClassAsValueType("QGenericArgument");
     lib.SetClassAsValueType("QGenericReturnArgument");
     lib.SetClassAsValueType("QVariant");
     lib.IgnoreClassMethodWithName("QString", "fromStdWString");
     lib.IgnoreClassMethodWithName("QString", "toStdWString");
     if (this.module == "Widgets")
     {
         // HACK: work around https://llvm.org/bugs/show_bug.cgi?id=24655
         foreach (var method in lib.FindCompleteClass("QAbstractSlider").Methods.Where(m => m.Access == AccessSpecifier.Protected))
         {
             method.AccessDecl.PreprocessedEntities.Clear();
         }
         string[] classesWithTypeEnums =
         {
             "QGraphicsEllipseItem", "QGraphicsItemGroup", "QGraphicsLineItem",
             "QGraphicsPathItem", "QGraphicsPixmapItem", "QGraphicsPolygonItem", "QGraphicsProxyWidget",
             "QGraphicsRectItem", "QGraphicsSimpleTextItem", "QGraphicsTextItem", "QGraphicsWidget"
         };
         foreach (var enumeration in classesWithTypeEnums.Select(c => lib.FindCompleteClass(c)).SelectMany(
             @class => @class.Enums.Where(e => string.IsNullOrEmpty(e.Name))))
         {
             enumeration.Name = "TypeEnum";
         }
     }
 }
开发者ID:nanox,项目名称:QtSharp,代码行数:51,代码来源:QtSharp.cs

示例11: Preprocess

        public void Preprocess(Driver driver, ASTContext ctx)
        {
            ctx.IgnoreHeadersWithName("API.h");
            ctx.IgnoreHeadersWithName("Concurrency.h");
            ctx.IgnoreHeadersWithName("ConcurrentQueue.h");
            ctx.IgnoreHeadersWithName("Delegate.h");
            ctx.IgnoreHeadersWithName("Event.h");
            ctx.IgnoreHeadersWithName("Handle.h");
            ctx.IgnoreHeadersWithName("Object.h");
            ctx.IgnoreHeadersWithName("Pointers.h");
            ctx.IgnoreHeadersWithName("References.h");
            ctx.IgnoreHeadersWithName("Reflection.h");
            ctx.IgnoreHeadersWithName("ReflectionHelpers.h");
            ctx.IgnoreHeadersWithName("Task.h");
            ctx.IgnoreHeadersWithName("Timer.h");
            ctx.IgnoreHeadersWithName("Swap.h");

            //Core
            ctx.IgnoreClassWithName("Object");
            ctx.IgnoreClassWithName("Class");
            ctx.IgnoreClassWithName("ReferenceCounted");
            ctx.IgnoreClassWithName("HandleManager");

            ctx.IgnoreClassWithName("Delegate0");
            ctx.IgnoreClassWithName("Delegate1");
            ctx.IgnoreClassWithName("Delegate2");

            ctx.IgnoreClassWithName("TaskPool");
            ctx.IgnoreClassWithName("ConcurrentQueue");

            ctx.SetClassAsValueType("StringHash");
            ctx.IgnoreClassWithName("RawStringCompare");

            ctx.SetClassAsValueType("LogEntry");
            ctx.IgnoreFunctionWithName("LogCreate");

            ctx.IgnoreFunctionWithName("AllocatorAllocate");
            ctx.IgnoreFunctionWithName("AllocatorDeallocate");
            ctx.SetNameOfFunction("AllocatorReset", "AllocatorResetMemory");

            ctx.IgnoreClassWithName("StreamFuncs");
            ctx.IgnoreClassWithName("FileStream");
            ctx.SetClassAsValueType("FileWatchEvent");

            ctx.IgnoreFunctionWithPattern(".+GetType");
            ctx.IgnoreFunctionWithName("ClassGetIdMap");

            ctx.IgnoreFunctionWithName("ReflectionSetHandleContext");
            ctx.IgnoreFunctionWithName("SerializerCreateJSON");
            ctx.IgnoreFunctionWithName("SerializerCreateBinary");
            ctx.IgnoreClassWithName("ReflectionContext");
            ctx.IgnoreClassWithName("ValueContext");

            ctx.SetClassAsValueType("ExtensionMetadata");

            ctx.IgnoreClassWithName("MemoryStream");
            ctx.IgnoreClassWithName("Serializer");
            ctx.IgnoreClassWithName("Thread");

            // Math
            ctx.SetClassAsValueType("ColorP");
            ctx.SetClassAsValueType("Color");
            ctx.SetClassAsValueType("Vector2P");
            ctx.SetClassAsValueType("Vector2");
            ctx.SetClassAsValueType("Vector2i");
            ctx.SetClassAsValueType("Vector3P");
            ctx.SetClassAsValueType("Vector3");
            ctx.SetClassAsValueType("Vector4");
            ctx.SetClassAsValueType("EulerAngles");
            ctx.SetClassAsValueType("QuaternionP");
            ctx.SetClassAsValueType("Quaternion");
            ctx.SetClassAsValueType("Matrix4x3");
            ctx.SetClassAsValueType("Matrix4x4");

            ctx.CopyClassFields("ColorP", "Color");
            ctx.CopyClassFields("Vector2P", "Vector2");
            ctx.CopyClassFields("Vector3P", "Vector3");
            ctx.CopyClassFields("QuaternionP", "Quaternion");

            ctx.IgnoreClassWithName("ColorP");
            ctx.IgnoreClassWithName("Vector2P");
            ctx.IgnoreClassWithName("Vector3P");
            ctx.IgnoreClassWithName("QuaternionP");

            ctx.SetNameOfClassMethod("Matrix4x3", "identity", "setIdentity");
            ctx.SetNameOfClassMethod("Matrix4x4", "identity", "setIdentity");
            ctx.SetNameOfClassMethod("Quaternion", "identity", "setIdentity");
            ctx.SetNameOfClassMethod("Vector2", "zero", "setZero");
            ctx.SetNameOfClassMethod("Vector3", "zero", "setZero");
            ctx.SetNameOfClassMethod("Vector4", "zero", "setZero");

            // Resources
            ctx.IgnoreFunctionWithName("ResourcesInitialize");
            ctx.IgnoreFunctionWithName("ResourcesDeinitialize");
            //lib.SetClassAsValueType("ResourceEvent");
            ctx.SetClassAsValueType("ResourceLoadOption");
            ctx.SetClassAsValueType("ResourceLoadOptions");
            ctx.SetNameOfClassMethod("Texture", "allocate", "alloc");
            ctx.ExcludeFromPass("ResourceHandleCreate", typeof (FunctionToInstanceMethodPass));

//.........这里部分代码省略.........
开发者ID:FloodProject,项目名称:flood,代码行数:101,代码来源:Flood.cs


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