public StructureMemberModel(string name, TypeModel type) { if (string.IsNullOrEmpty(name)) throw new ArgumentException("Value may not be null or empty.", "key"); if (type == null) throw new ArgumentNullException("type"); Name = name; Type = type; }
public ParameterModel(string name, TypeModel type, int indirectionLevel, ParameterModelFlags flags, string length) { if (string.IsNullOrEmpty(name)) throw new ArgumentException("Value may not be null or empty.", "name"); if (type == null) throw new ArgumentNullException("type"); Name = name; Type = type; Flags = flags; IndirectionLevel = indirectionLevel; SizeParameter = length; }
public Type ResolveType(TypeModel model) { if (model == null) return null; if (model is EnumerationModel) return typeof(int); var translation = model as TranslationModel; if (translation != null) { var type = Type.GetType(translation.TargetType); if (type.IsValueType && Marshal.SizeOf(type) <= sizeof(long)) return type; } return typeof(IntPtr); }
public MarshalBehavior ResolveBehavior(TypeModel model) { var translation = model as TranslationModel; if (translation != null) { var type = Type.GetType(translation.TargetType); if (type == typeof(string)) return MarshalBehavior.String; } if (model is EnumerationModel) return MarshalBehavior.Enumeration; if (model is StructureModel) return MarshalBehavior.Structure; if (model is InterfaceModel || model.Key == "IUnknown") return MarshalBehavior.Interface; return MarshalBehavior.Direct; }
public FunctionModel(ApiModel api, string name, TypeModel returnType) { Api = api; Name = name; Type = returnType; }
public VariableModel(string name, TypeModel type) { Name = name; Type = type; }