private bool IsPreserveOutputsAsSafeOrSaferThan(UnsafeOptions otherUnsafeOptions) { return(m_preservedOutputInfo == null || UnsafeConfiguration.PreserveOutputs == PreserveOutputsMode.Disabled || (otherUnsafeOptions.UnsafeConfiguration.PreserveOutputs != PreserveOutputsMode.Disabled && (m_preservedOutputInfo.Value.IsAsSafeOrSaferThan(otherUnsafeOptions.PreserveOutputsSalt)))); }
/// <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; }
/// <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)); }
/// <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)); }
/// <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)); }