public void SetParameter(TemplateParameterType type, string value) { if (Parameters.ContainsKey(type)) { Parameters[type] = value; } }
public override AST.Type VisitTemplateParameter(TemplateParameterType type) { var _type = new AST.TemplateParameterType(); _type.Parameter = DeclConverter.VisitTemplateParameter(type.Parameter); VisitType(type, _type); return(_type); }
public override TypePrinterResult VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) { if (param.Parameter == null || param.Parameter.Name == null) { return(string.Empty); } return(param.Parameter.Name); }
public string VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) { if (param.Parameter.Name == null) { return(string.Empty); } return(param.Parameter.Name); }
public void add_input_param(Template template, TemplateParameterType param) { if (template != null) { if (template.ParameterList == null) { template.ParameterList = new List <TemplateParameterType>(); } template.ParameterList.Add(param); } }
public static string ToCsharpIdent(this string file, TemplateParameterType type) { switch (type) { case TemplateParameterType.File: return(Path.GetFileNameWithoutExtension(file).ToCsharpIdent(false)); case TemplateParameterType.Directory: return(Path.GetDirectoryName(file).ToCsharpIdent(false)); case TemplateParameterType.Extension: return(Path.GetFullPath(file).Replace(Path.GetExtension(file), "").ToCsharpIdent(false)); case TemplateParameterType.None: default: return(file.ToCsharpIdent(false)); } }
public TemplateParameter(JsonNode jsonNode, Template template) { m_name = jsonNode.GetObjectOrDefault("name", "unknown"); m_type = jsonNode.GetObjectOrDefault("type", TemplateParameterType.Undefined); m_value = jsonNode.GetObjectOrDefault("default", ""); template.AddParameters(ref m_value, null, null); m_isEditable = !jsonNode.GetObjectOrDefault("isreadonly", false); m_description = jsonNode.GetObjectOrDefault<string>("description", null); m_key = jsonNode.GetObjectOrDefault<string>("key", null); string pathSeparator = jsonNode.GetObjectOrDefault("pathseparator", "\\"); m_pathSeparator = pathSeparator.Length > 0 ? pathSeparator[0] : '\\'; if (m_type == TemplateParameterType.File) { if (string.IsNullOrEmpty(m_value)) m_value = template.TargetPath; m_value = m_value.Replace('\\', m_pathSeparator); } }
private TemplateParameterType(TemplateParameterType.Internal native, bool skipVTables = false) : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; }
public bool VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) { return(false); }
public string VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) { return(param.Parameter.Name); }
private TemplateParameterType(TemplateParameterType.Internal native) : this(__CopyValue(native)) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; }
public static TemplateParameterType __CreateInstance(TemplateParameterType.Internal native) { return new TemplateParameterType(native); }
public CSharpTypePrinterResult VisitTemplateParameterType( TemplateParameterType param, TypeQualifiers quals) { return(param.Parameter.Name); }
public abstract TRet VisitTemplateParameter(TemplateParameterType type);
internal TemplateParameterType(TemplateParameterType.Internal* native) : this(new global::System.IntPtr(native)) { }
internal TemplateParameterType(TemplateParameterType.Internal native) : this(&native) { }
private TemplateParameterType(TemplateParameterType.Internal native) : this(__CopyValue(native)) { __ownsNativeInstance = true; }
internal TemplateParameterType(TemplateParameterType.Internal native) : this(__CopyValue(native)) { }
public virtual TypePrinterResult VisitTemplateParameterType( TemplateParameterType param, TypeQualifiers quals) { throw new NotImplementedException(); }
protected TemplateParameterType(TemplateParameterType.Internal* native, bool skipVTables = false) : base((CppSharp.Parser.AST.Type.Internal*) null) { __PointerAdjustment = 0; if (native == null) return; __Instance = new global::System.IntPtr(native); }
public TRet Visit(Parser.AST.Type type) { if (type.__Instance == IntPtr.Zero) { return(default(TRet)); } switch (type.Kind) { case TypeKind.Tag: { var _type = new TagType(type.__Instance); return(VisitTag(_type)); } case TypeKind.Array: { var _type = new ArrayType(type.__Instance); return(VisitArray(_type)); } case TypeKind.Function: { var _type = new FunctionType(type.__Instance); return(VisitFunction(_type)); } case TypeKind.Pointer: { var _type = new PointerType(type.__Instance); return(VisitPointer(_type)); } case TypeKind.MemberPointer: { var _type = new MemberPointerType(type.__Instance); return(VisitMemberPointer(_type)); } case TypeKind.Typedef: { var _type = new TypedefType(type.__Instance); return(VisitTypedef(_type)); } case TypeKind.Attributed: { var _type = new AttributedType(type.__Instance); return(VisitAttributed(_type)); } case TypeKind.Decayed: { var _type = new DecayedType(type.__Instance); return(VisitDecayed(_type)); } case TypeKind.TemplateSpecialization: { var _type = new TemplateSpecializationType(type.__Instance); return(VisitTemplateSpecialization(_type)); } case TypeKind.TemplateParameter: { var _type = new TemplateParameterType(type.__Instance); return(VisitTemplateParameter(_type)); } case TypeKind.TemplateParameterSubstitution: { var _type = new TemplateParameterSubstitutionType(type.__Instance); return(VisitTemplateParameterSubstitution(_type)); } case TypeKind.InjectedClassName: { var _type = new InjectedClassNameType(type.__Instance); return(VisitInjectedClassName(_type)); } case TypeKind.DependentName: { var _type = new DependentNameType(type.__Instance); return(VisitDependentName(_type)); } case TypeKind.Builtin: { var _type = new BuiltinType(type.__Instance); return(VisitBuiltin(_type)); } } throw new ArgumentOutOfRangeException(); }
public TemplateParameter(string name, TemplateParameterType type = TemplateParameterType.Undefined) { m_name = name; m_type = type; m_pathSeparator = '\\'; }
public override bool VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) { Context.Return.Write(param.Parameter.Name); return true; }
public override bool VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) { Context.Return.Write(param.Parameter.Name); return(true); }
public static IEnumerable <IGrouping <string, string> > Segmentize(this IEnumerable <string> files, TemplateParameterType type) { switch (type) { case TemplateParameterType.File: return(files.GroupBy(Path.GetDirectoryName)); case TemplateParameterType.Directory: return(files.GroupBy(Path.GetFileNameWithoutExtension)); case TemplateParameterType.Extension: return(files.GroupBy(Path.GetExtension)); case TemplateParameterType.None: default: return(files.GroupBy(m => m)); } }
public bool VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) { throw new NotImplementedException(); }
public override bool VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) { throw new NotImplementedException(); }
private static TemplateParameterType.Internal* __CopyValue(TemplateParameterType.Internal native) { var ret = Marshal.AllocHGlobal(56); CppSharp.Parser.AST.TemplateParameterType.Internal.cctor_2(ret, new global::System.IntPtr(&native)); return (TemplateParameterType.Internal*) ret; }
private static void* __CopyValue(TemplateParameterType.__Internal native) { var ret = Marshal.AllocHGlobal(24); global::CppSharp.Parser.AST.TemplateParameterType.__Internal.cctor_1(ret, new global::System.IntPtr(&native)); return ret.ToPointer(); }
protected TemplateParameterType(TemplateParameterType.Internal* native, bool isInternalImpl = false) : base((CppSharp.Parser.AST.Type.Internal*) native) { }
public static TemplateParameterType __CreateInstance(TemplateParameterType.Internal native, bool skipVTables = false) { return new TemplateParameterType(native, skipVTables); }
public virtual bool VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) { return(VisitType(param, quals)); }
public override TypePrinterResult VisitTemplateParameterType( TemplateParameterType param, TypeQualifiers quals) { return(param.Parameter?.Name ?? string.Empty); }