public MemberDefinitionBase(XmlElement elem, ClassDefinition containingClass) : base(containingClass.MetaDef) { _containingClass = containingClass; IsStatic = elem.GetAttribute("static") == "yes"; ProtectionLevel = ProtectionLevelExtensions.ParseProtectionLevel(elem.GetAttribute("protection")); _passedByType = (PassedByType)Enum.Parse(typeof(PassedByType), elem.GetAttribute("passedBy"), true); foreach (XmlElement child in elem.ChildNodes) { switch (child.Name) { case "name": _nativeName = child.InnerText; break; case "type": _typeName = child.InnerText; _container = child.GetAttribute("container"); _containerKey = child.GetAttribute("containerKey"); _containerValue = child.GetAttribute("containerValue"); break; case "definition": Definition = child.InnerText; break; default: // Let the subclass decide what to do with this. InterpretChildElement(child); break; } } }
public DefMember(XmlElement elem) { this._elem = elem; this.ProtectionType = DefType.GetProtectionEnum(elem.GetAttribute("protection")); this.PassedByType = (PassedByType)Enum.Parse(typeof(PassedByType), elem.GetAttribute("passedBy"), true); foreach (XmlElement child in elem.ChildNodes) { switch (child.Name) { case "name": _name = child.InnerText; break; case "type": this.TypeName = child.InnerText; this._container = child.GetAttribute("container"); this._containerKey = child.GetAttribute("containerKey"); this._containerValue = child.GetAttribute("containerValue"); break; case "definition": this.Definition = child.InnerText; break; default: InterpretChildElement(child); break; } } }
public virtual string GetNativeTypeName(bool isConst, PassedByType passed) { string postfix = null; switch (passed) { case PassedByType.Pointer: postfix = "*"; break; case PassedByType.PointerPointer: postfix = "**"; break; case PassedByType.Reference: postfix = "&"; break; case PassedByType.Value: postfix = ""; break; default: throw new Exception("Unexpected"); } return((isConst ? "const " : "") + FullyQualifiedNativeName + postfix); }
public DefParam(ITypeMember m, string name) { this._name = name; this._type = m.Type; this._typename = m.TypeName; this.PassedByType = m.PassedByType; this._isConst = m.IsConst; }
public ParamDefinition(MetaDefinition metaDef, ITypeMember m, string name) : base(metaDef) { _name = name; _type = m.MemberType; _typename = m.MemberTypeName; PassedByType = m.PassedByType; _isConst = m.IsConst; }
public TypeParamDefinition(AbstractTypeDefinition type, PassedByType passed, bool isConst) { ParamType = type; _passed = passed; _isConst = isConst; }
public DefParam(XmlElement elem) { this._elem = elem; this.PassedByType = (PassedByType)Enum.Parse(typeof(PassedByType), elem.GetAttribute("passedBy"), true); }
public DefTypeMember(DefType type, PassedByType passed, bool isConst) { this._type = type; this._passed = passed; this._isConst = isConst; }
public ParamDefinition(MetaDefinition metaDef, XmlElement elem) : base(metaDef) { _elem = elem; PassedByType = (PassedByType)Enum.Parse(typeof(PassedByType), elem.GetAttribute("passedBy"), true); }