< Summary

Information
Line coverage
0%
Covered lines: 0
Uncovered lines: 3
Coverable lines: 3
Total lines: 52
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
IsValid(...)100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEStreamOptions.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4namespace System.Reflection.PortableExecutable
 5{
 6    [Flags]
 7    public enum PEStreamOptions
 8    {
 9        /// <summary>
 10        /// By default the stream is disposed when <see cref="PEReader"/> is disposed and sections of the PE image are r
 11        /// </summary>
 12        Default = 0,
 13
 14        /// <summary>
 15        /// Keep the stream open when the <see cref="PEReader"/> is disposed.
 16        /// </summary>
 17        LeaveOpen = 1,
 18
 19        /// <summary>
 20        /// Reads metadata section into memory right away.
 21        /// </summary>
 22        /// <remarks>
 23        /// Reading from other sections of the file is not allowed (<see cref="InvalidOperationException"/> is thrown by
 24        /// The underlying file may be closed and even deleted after <see cref="PEReader"/> is constructed.
 25        ///
 26        /// <see cref="PEReader"/> closes the stream automatically by the time the constructor returns unless <see cref=
 27        /// </remarks>
 28        PrefetchMetadata = 1 << 1,
 29
 30        /// <summary>
 31        /// Reads the entire image into memory right away.
 32        /// </summary>
 33        /// <remarks>
 34        /// <see cref="PEReader"/> closes the stream automatically by the time the constructor returns unless <see cref=
 35        /// </remarks>
 36        PrefetchEntireImage = 1 << 2,
 37
 38        /// <summary>
 39        /// Indicates that the underlying PE image has been loaded into memory by the OS loader.
 40        /// </summary>
 41        IsLoadedImage = 1 << 3,
 42    }
 43
 44    internal static class PEStreamOptionsExtensions
 45    {
 46        public static bool IsValid(this PEStreamOptions options)
 047        {
 048            return (options & ~(PEStreamOptions.LeaveOpen | PEStreamOptions.PrefetchEntireImage | PEStreamOptions.Prefet
 049        }
 50    }
 51}
 52