Beispiel #1
0
 public bool TryReadGroupFrame(IBinaryReadStream stream, out GroupFrame frame, bool checkIsGroup = true)
 {
     if (!TryGetGroup(stream, out var meta, checkIsGroup: checkIsGroup))
     {
         frame = default;
         return(false);
     }
     frame = new GroupFrame(meta, stream.ReadSpan(checked ((int)meta.TotalLength)));
     return(true);
 }
Beispiel #2
0
        // Not an extension method, as we don't want it to show up as intellisense, as it's already part of a GroupFrame's enumerator.
        /// <summary>
        /// Enumerates locations of the contained subrecords.<br/>
        /// Locations are relative to the RecordType of the MajorRecordFrame.
        /// </summary>
        public static IEnumerable <MajorRecordPinFrame> EnumerateRecords(GroupFrame group)
        {
            int loc = group.HeaderLength;

            while (loc < group.HeaderAndContentData.Length)
            {
                var subHeader = new MajorRecordPinFrame(group.Meta, group.HeaderAndContentData.Slice(loc), loc);
                yield return(subHeader);

                loc = checked ((int)(loc + subHeader.TotalLength));
            }
        }
Beispiel #3
0
 public static bool TryReadGroupFrame(this IMutagenReadStream stream, out GroupFrame frame, bool checkIsGroup             = true) => stream.MetaData.Constants.TryReadGroupFrame(stream, out frame, checkIsGroup);
Beispiel #4
0
 public static bool TryGetGroupFrame(this IMutagenReadStream stream, out GroupFrame header, int offset = 0, bool checkIsGroup = true) => stream.MetaData.Constants.TryGetGroupFrame(stream, out header, offset, checkIsGroup);