LSLib.LS.LSF.LSFReader.ReadAttributesV3 C# (CSharp) Méthode

ReadAttributesV3() private méthode

Reads the V3 attribute headers for the LSOF resource
private ReadAttributesV3 ( Stream s ) : void
s Stream Stream to read the attribute headers from
Résultat void
        private void ReadAttributesV3(Stream s)
        {
            Attributes = new List<AttributeInfo>();
            using (var reader = new BinaryReader(s))
            {
                while (s.Position < s.Length)
                {
                    var attribute = BinUtils.ReadStruct<AttributeEntryV3>(reader);

                    var resolved = new AttributeInfo();
                    resolved.NameIndex = attribute.NameIndex;
                    resolved.NameOffset = attribute.NameOffset;
                    resolved.TypeId = attribute.TypeId;
                    resolved.Length = attribute.Length;
                    resolved.DataOffset = attribute.Offset;
                    resolved.NextAttributeIndex = attribute.NextAttributeIndex;

                    Attributes.Add(resolved);
                }

#if DEBUG_LSF_SERIALIZATION
                Console.WriteLine(" ----- DUMP OF V3 ATTRIBUTE TABLE -----");
                for (int i = 0; i < Attributes.Count; i++)
                {
                    var resolved = Attributes[i];

                    var debug = String.Format(
                        "{0}: {1} (offset {2:X}, typeId {3}, nextAttribute {4})",
                        i, Names[resolved.NameIndex][resolved.NameOffset], resolved.DataOffset,
                        resolved.TypeId, resolved.NextAttributeIndex
                    );
                    Console.WriteLine(debug);
                }
#endif
            }
        }