예제 #1
0
파일: FPod.cs 프로젝트: syatanic/fantom
        private void readPodMeta(FStore.Input input)
        {
            // handle sys bootstrap specially using just java.util.Properties
            string metaName;

            if ("sys" == m_podName)
            {
                Properties props = new Properties();
                props.load(input);
                input.Close();
                metaName       = props.getProperty("pod.name");
                m_podVersion   = props.getProperty("pod.version");
                m_fcodeVersion = props.getProperty("fcode.version");
                m_depends      = new Depend[0];
                return;
            }
            else
            {
                SysInStream sysIn = new SysInStream(input);
                this.m_meta = (Map)sysIn.readProps().toImmutable();
                sysIn.close();

                metaName     = meta("pod.name");
                m_podVersion = meta("pod.version");

                m_fcodeVersion = meta("fcode.version");
                string dependsStr = meta("pod.depends").Trim();
                if (dependsStr.Length == 0)
                {
                    m_depends = new Depend[0];
                }
                else
                {
                    string[] toks = dependsStr.Split(';');
                    m_depends = new Depend[toks.Length];
                    for (int i = 0; i < m_depends.Length; ++i)
                    {
                        m_depends[i] = Depend.fromStr(toks[i].Trim());
                    }
                }
            }

            // check meta name matches podName passed to ctor
            if (m_podName == null)
            {
                m_podName = metaName;
            }
            if (m_podName != metaName)
            {
                throw new System.IO.IOException("Pod name mismatch " + m_podName + " != " + metaName);
            }

            // sanity checking
            if (FConst.FCodeVersion != m_fcodeVersion)
            {
                throw new System.IO.IOException("Invalid fcode version " + m_fcodeVersion);
            }
        }
예제 #2
0
파일: FPod.cs 프로젝트: syatanic/fantom
 private void readTypeMeta(FStore.Input input)
 {
     m_types = new FType[input.u2()];
     for (int i = 0; i < m_types.Length; i++)
     {
         m_types[i]          = new FType(this).readMeta(input);
         m_types[i].m_hollow = true;
     }
     input.Close();
 }
예제 #3
0
        public void read(FStore.Input input)
        {
            if (input.fpod.m_fcodeVersion == null)
            {
                throw new IOException("FStore.Input.version == null");
            }

            m_fields = new FField[input.u2()];
            for (int i = 0; i < m_fields.Length; i++)
            {
                m_fields[i] = new FField().read(input);
            }

            m_methods = new FMethod[input.u2()];
            for (int i = 0; i < m_methods.Length; i++)
            {
                m_methods[i] = new FMethod().read(input);
            }

            m_attrs = FAttrs.read(input);

            m_hollow = false;
            input.Close();
        }