private void _read()
            {
                _name = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytes(4));
                _size = m_io.ReadU4le();
                switch (Name)
                {
                case "SLBR": {
                    __raw_body = m_io.ReadBytes(Size);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new SectionStartingResource(io___raw_body, this, m_root);
                    break;
                }

                case "ERAX": {
                    __raw_body = m_io.ReadBytes(Size);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new SectionEra(io___raw_body, this, m_root);
                    break;
                }

                case "OWNR": {
                    __raw_body = m_io.ReadBytes(Size);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new SectionOwnr(io___raw_body, this, m_root);
                    break;
                }

                case "ERA ": {
                    __raw_body = m_io.ReadBytes(Size);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new SectionEra(io___raw_body, this, m_root);
                    break;
                }

                case "SGLD": {
                    __raw_body = m_io.ReadBytes(Size);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new SectionStartingResource(io___raw_body, this, m_root);
                    break;
                }

                case "VER ": {
                    __raw_body = m_io.ReadBytes(Size);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new SectionVer(io___raw_body, this, m_root);
                    break;
                }

                case "SOIL": {
                    __raw_body = m_io.ReadBytes(Size);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new SectionStartingResource(io___raw_body, this, m_root);
                    break;
                }

                case "UNIT": {
                    __raw_body = m_io.ReadBytes(Size);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new SectionUnit(io___raw_body, this, m_root);
                    break;
                }

                case "DIM ": {
                    __raw_body = m_io.ReadBytes(Size);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new SectionDim(io___raw_body, this, m_root);
                    break;
                }

                case "TYPE": {
                    __raw_body = m_io.ReadBytes(Size);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new SectionType(io___raw_body, this, m_root);
                    break;
                }

                default: {
                    _body = m_io.ReadBytes(Size);
                    break;
                }
                }
            }
Example #2
0
 private void StartSection(SectionUnit sectionUnit, IniOptions options) => StartSection(Section.FromParsedSectionUnit(sectionUnit, options));
Example #3
0
 public static Section FromParsedSectionUnit(SectionUnit sectionUnit, IniOptions options) => new Section(sectionUnit.Name, options)
 {
     Comment = sectionUnit.Comment
 };