Team Ai
Datasetpublic

MegaBites-AI/Windows-powershell

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes372downloads
IContentReader.cs69 linesDownload Raw Back to namespaces
1// Copyright (c) Microsoft Corporation.2// Licensed under the MIT License.3 4using System.Collections;5using System.IO;6 7#nullable enable8namespace System.Management.Automation.Provider9{10    #region IContentReader11 12    /// <summary>13    /// A Cmdlet provider that implements the IContentCmdletProvider interface must provide an14    /// object that implements this interface when GetContentReader() is called.15    ///16    /// The interface allows for reading content from an item.17    /// </summary>18    public interface IContentReader : IDisposable19    {20        /// <summary>21        /// Reads the content from the item.22        /// </summary>23        /// <param name="readCount">24        /// The number of "blocks" of data to be read from the item.25        /// </param>26        /// <returns>27        /// An array of the blocks of data read from the item.28        /// </returns>29        /// <remarks>30        /// A "block" of content is provider specific.  For the file system31        /// a "block" may be considered a line of text, a byte, a character, or delimited string.32        ///33        /// The implementation of this method should break the content down into meaningful blocks34        /// that the user may want to manipulate individually. The number of blocks to return is35        /// indicated by the <paramref name="readCount"/> parameter.36        /// </remarks>37        IList Read(long readCount);38 39        /// <summary>40        /// Moves the current "block" to be read to a position relative to a place41        /// in the reader.42        /// </summary>43        /// <param name="offset">44        /// An offset of the number of blocks to seek from the origin.45        /// </param>46        /// <param name="origin">47        /// The place in the stream to start the seek from.48        /// </param>49        /// <remarks>50        /// The implementation of this method moves the content reader <paramref name="offset"/>51        /// number of blocks from the specified <paramref name="origin"/>. See <see cref="IContentReader.Read"/>52        /// for a description of what a block is.53        /// </remarks>54        void Seek(long offset, SeekOrigin origin);55 56        /// <summary>57        /// Closes the reader. Further reads should fail if the reader58        /// has been closed.59        /// </summary>60        /// <remarks>61        /// The implementation of this method should close any resources held open by the62        /// reader.63        /// </remarks>64        void Close();65    }66 67    #endregion IContentReader68}69