Example #1
0
 private bool IsPreserveOutputsAsSafeOrSaferThan(UnsafeOptions otherUnsafeOptions)
 {
     return(m_preservedOutputInfo == null ||
            UnsafeConfiguration.PreserveOutputs == PreserveOutputsMode.Disabled ||
            (otherUnsafeOptions.UnsafeConfiguration.PreserveOutputs != PreserveOutputsMode.Disabled &&
             (m_preservedOutputInfo.Value.IsAsSafeOrSaferThan(otherUnsafeOptions.PreserveOutputsSalt))));
 }
Example #2
0
 /// <summary>
 /// Constructs a path set from already-sorted paths. The array may contain duplicates.
 /// </summary>
 public ObservedPathSet(
     SortedReadOnlyArray <ObservedPathEntry, ObservedPathEntryExpandedPathComparer> paths,
     SortedReadOnlyArray <StringId, CaseInsensitiveStringIdComparer> observedAccessedFileNames,
     [CanBeNull] UnsafeOptions unsafeOptions)
 {
     Contract.Requires(paths.IsValid);
     Paths = paths;
     ObservedAccessedFileNames = observedAccessedFileNames;
     UnsafeOptions             = unsafeOptions ?? UnsafeOptions.SafeValues;
 }
Example #3
0
 /// <summary>
 /// Checks if this instance of <see cref="UnsafeOptions"/> is less safe than <paramref name="other"/>.
 /// </summary>
 public bool IsLessSafeThan(UnsafeOptions other)
 {
     return(!IsAsSafeOrSaferThan(other));
 }
Example #4
0
 /// <summary>
 /// Checks if this instance of <see cref="UnsafeOptions"/> is as safe or safer than <paramref name="other"/>.
 /// </summary>
 public bool IsAsSafeOrSaferThan(UnsafeOptions other)
 {
     return(UnsafeConfiguration.IsAsSafeOrSaferThan(other.UnsafeConfiguration) && IsPreserveOutputsAsSafeOrSaferThan(other));
 }
Example #5
0
 /// <summary>
 /// Returns a new instance of <see cref="ObservedPathSet"/> with updated <see cref="UnsafeOptions"/> value.
 /// </summary>
 public ObservedPathSet WithUnsafeOptions(UnsafeOptions newUnsafeOptions)
 {
     return(new ObservedPathSet(Paths, ObservedAccessedFileNames, newUnsafeOptions));
 }