本文整理汇总了C#中Class.IsSupportedStdType方法的典型用法代码示例。如果您正苦于以下问题:C# Class.IsSupportedStdType方法的具体用法?C# Class.IsSupportedStdType怎么用?C# Class.IsSupportedStdType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Class
的用法示例。
在下文中一共展示了Class.IsSupportedStdType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitClassDecl
public override bool VisitClassDecl(Class @class)
{
if (!base.VisitClassDecl(@class) || [email protected] ||
Driver.Options.IsCLIGenerator || [email protected]())
return false;
// we only need a few members for marshalling so strip the rest
switch (@class.Name)
{
case "basic_string":
foreach (var specialization in @class.Specializations.Where(
s => s.IsSupportedStdSpecialization()))
{
MarkForGeneration(specialization);
foreach (var method in specialization.Methods.Where(m => m.OriginalName != "c_str"))
method.ExplicitlyIgnore();
var l = specialization.Methods.Where(m => m.IsConstructor && m.Parameters.Count == 2).ToList();
var ctor = specialization.Methods.Single(m => m.IsConstructor && m.Parameters.Count == 2 &&
m.Parameters[0].Type.Desugar().IsPointerToPrimitiveType(PrimitiveType.Char) &&
!m.Parameters[1].Type.Desugar().IsPrimitiveType());
ctor.GenerationKind = GenerationKind.Generate;
foreach (var parameter in ctor.Parameters)
parameter.DefaultArgument = null;
}
break;
case "allocator":
foreach (var specialization in @class.Specializations.Where(
s => s.IsSupportedStdSpecialization()))
{
MarkForGeneration(specialization);
foreach (var method in specialization.Methods.Where(m => !m.IsConstructor || m.Parameters.Any()))
method.ExplicitlyIgnore();
}
break;
}
return true;
}
示例2: VisitClassDecl
public override bool VisitClassDecl(Class @class)
{
if (VisitDeclarationContext(@class) && [email protected]())
{
if (Options.VisitClassBases)
foreach (var baseClass in @class.Bases)
if (baseClass.IsClass)
VisitClassDecl(baseClass.Class);
new PropertyGenerator(@class, Log).GenerateProperties();
}
return false;
}