Esempio n. 1
0
 /// <summary>
 /// Returns all recorded paths inside the <paramref name="sidebandFile"/> sideband file.
 /// </summary>
 public static IReadOnlyList <string> ReadSidebandFile(string sidebandFile, bool ignoreChecksum)
 {
     using var sidebandReader = new SidebandReader(sidebandFile);
     sidebandReader.ReadHeader(ignoreChecksum: ignoreChecksum);
     sidebandReader.ReadMetadata();
     return(sidebandReader.ReadRecordedPaths().ToList());
 }
Esempio n. 2
0
        /// <summary>
        /// Returns all recorded paths inside the <paramref name="sidebandFile"/> sideband file.
        /// </summary>
        public static (IReadOnlyList <string> Paths, SidebandMetadata Metadata) ReadSidebandFile(string sidebandFile, bool ignoreChecksum)
        {
            using var sidebandReader = new SidebandReader(sidebandFile);
            sidebandReader.ReadHeader(ignoreChecksum: ignoreChecksum);
            var metadata = sidebandReader.ReadMetadata();
            var paths    = sidebandReader.ReadRecordedPaths().ToList();

            return(paths, metadata);
        }
Esempio n. 3
0
        /// <summary>
        /// Returns all paths recorded in the <paramref name="filePath"/> file, even if the
        /// file appears to be corrupted.
        ///
        /// If file at <paramref name="filePath"/> does not exist, returns an empty iterator.
        ///
        /// <seealso cref="SidebandReader.ReadRecordedPaths"/>
        /// </summary>
        public static string[] ReadRecordedPathsFromSidebandFile(string filePath)
        {
            if (!File.Exists(filePath))
            {
                return(CollectionUtilities.EmptyArray <string>());
            }

            using (var reader = new SidebandReader(filePath))
            {
                reader.ReadHeader(ignoreChecksum: true);
                reader.ReadMetadata();
                return(reader.ReadRecordedPaths().ToArray());
            }
        }