Esempio n. 1
0
        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;
                }
            }
        }
Esempio n. 2
0
        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;
                }
            }
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
 public ParamDefinition(MetaDefinition metaDef, ITypeMember m, string name)
     : base(metaDef)
 {
     _name        = name;
     _type        = m.MemberType;
     _typename    = m.MemberTypeName;
     PassedByType = m.PassedByType;
     _isConst     = m.IsConst;
 }
Esempio n. 6
0
 public TypeParamDefinition(AbstractTypeDefinition type, PassedByType passed, bool isConst)
 {
     ParamType = type;
     _passed   = passed;
     _isConst  = isConst;
 }
Esempio n. 7
0
 public DefParam(XmlElement elem)
 {
     this._elem        = elem;
     this.PassedByType = (PassedByType)Enum.Parse(typeof(PassedByType), elem.GetAttribute("passedBy"), true);
 }
Esempio n. 8
0
 public DefTypeMember(DefType type, PassedByType passed, bool isConst)
 {
     this._type    = type;
     this._passed  = passed;
     this._isConst = isConst;
 }
Esempio n. 9
0
 public ParamDefinition(MetaDefinition metaDef, XmlElement elem)
     : base(metaDef)
 {
     _elem        = elem;
     PassedByType = (PassedByType)Enum.Parse(typeof(PassedByType), elem.GetAttribute("passedBy"), true);
 }