コード例 #1
0
ファイル: QuickTimeFile.cs プロジェクト: yinghau76/filewalk
        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;
        }
コード例 #2
0
ファイル: RiffFile.cs プロジェクト: yinghau76/filewalk
        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;
        }
コード例 #3
0
ファイル: QuickTimeFile.cs プロジェクト: yinghau76/filewalk
        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();
        }