Beispiel #1
0
        private StructInstance GetAtomInstance(BinaryReader reader, StructElement atomDef, uint atomSize, StructInstance parent)
        {
            StructInstance inst = null;

            if (atomDef != null)
            {
                int size = atomDef.Size;
                if (size != 0)
                {
                    inst = atomDef.Parse(parent, reader.BaseStream, reader.BaseStream.Position + atomSize - 8) as StructInstance;
                }
                else
                {
                    inst = atomDef.Parse(parent, null, 0) as StructInstance;
                }
            }

            return inst;
        }
Beispiel #2
0
        private StructInstance GetChunkInstance(BinaryReader reader, StructElement chunkDef, int chunkSize, StructInstance parent)
        {
            StructInstance inst = null;

            if (chunkDef != null)
            {
                int size = chunkDef.Size;
                if (size != 0)
                {
                    inst = chunkDef.Parse(parent, reader.BaseStream, reader.BaseStream.Position + chunkSize) as StructInstance;
                }
                else
                {
                    inst = chunkDef.Parse(parent, null, 0) as StructInstance;
                }
            }

            return inst;
        }
Beispiel #3
0
        private string GetAtomDesc(StructElement atomDef, uint atomSize, StructInstance inst)
        {
            StringBuilder sb = new StringBuilder();

            if (atomDef != null && atomDef.Description != string.Empty)
            {
                sb.Append(atomDef.Description);
                sb.Append("\r\n\r\n");
            }
            sb.AppendFormat("Atom size = {0}\r\n\r\n", atomSize);

            if (inst != null)
            {
                sb.Append(FileSchema.DumpInstance(inst, string.Empty));
            }

            return sb.ToString();
        }