Show / Hide Table of Contents

    Class Csv

    Contains helper methods for CSV processing.

    Inheritance
    Object
    Csv
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Cursively
    Assembly: Cursively.dll
    Syntax
    [Obsolete("ProcessFoo methods have been moved to instance methods on dedicated 'input' types for better composability.")]
    public static class Csv

    Methods

    | Improve this Doc View Source

    ProcessFile(String, CsvReaderVisitorBase)

    Describes the entire contents of a CSV file to the given instance of the CsvReaderVisitorBase class.

    Declaration
    [Obsolete("Use CsvSyncInput.ForMemoryMappedFile(csvFilePath).Process(visitor).")]
    public static void ProcessFile(string csvFilePath, CsvReaderVisitorBase visitor)
    Parameters
    Type Name Description
    String csvFilePath

    The path to the CSV file to describe.

    CsvReaderVisitorBase visitor

    The CsvReaderVisitorBase instance to describe the file to.

    Remarks

    The current version of this method uses memory-mapping behind the scenes in order to minimize the overhead of copying and cutting across discrete buffers, at the expense of slightly more overhead to set up the memory map than a typical read-from-stream pattern.

    Exceptions
    Type Condition
    ArgumentNullException

    See FileStream(String, FileMode, FileAccess, FileShare, Int32, FileOptions).

    ArgumentException

    See FileStream(String, FileMode, FileAccess, FileShare, Int32, FileOptions).

    NotSupportedException

    See FileStream(String, FileMode, FileAccess, FileShare, Int32, FileOptions).

    FileNotFoundException

    See FileStream(String, FileMode, FileAccess, FileShare, Int32, FileOptions).

    IOException

    See FileStream(String, FileMode, FileAccess, FileShare, Int32, FileOptions).

    See CreateViewAccessor(Int64, Int64, MemoryMappedFileAccess).

    SecurityException

    See FileStream(String, FileMode, FileAccess, FileShare, Int32, FileOptions).

    DirectoryNotFoundException

    See FileStream(String, FileMode, FileAccess, FileShare, Int32, FileOptions).

    UnauthorizedAccessException

    See FileStream(String, FileMode, FileAccess, FileShare, Int32, FileOptions).

    PathTooLongException

    See FileStream(String, FileMode, FileAccess, FileShare, Int32, FileOptions).

    | Improve this Doc View Source

    ProcessStream(Stream, CsvReaderVisitorBase)

    Describes the contents of a CSV stream to the given instance of the CsvReaderVisitorBase class.

    Declaration
    [Obsolete("Use CsvSyncInput.ForStream(csvStream).Process(visitor).")]
    public static void ProcessStream(Stream csvStream, CsvReaderVisitorBase visitor)
    Parameters
    Type Name Description
    Stream csvStream

    The CSV stream to describe.

    CsvReaderVisitorBase visitor

    The CsvReaderVisitorBase instance to describe the stream to.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when csvStream is null.

    | Improve this Doc View Source

    ProcessStream(Stream, CsvReaderVisitorBase, Int32)

    Describes the contents of a CSV stream to the given instance of the CsvReaderVisitorBase class.

    Declaration
    [Obsolete("Use CsvSyncInput.ForStream(csvStream).WithMinReadBufferByteCount(bufferSize).Process(visitor).")]
    public static void ProcessStream(Stream csvStream, CsvReaderVisitorBase visitor, int bufferSize)
    Parameters
    Type Name Description
    Stream csvStream

    The CSV stream to describe.

    CsvReaderVisitorBase visitor

    The CsvReaderVisitorBase instance to describe the stream to.

    Int32 bufferSize

    The length of the buffer to use (default: 81920).

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when csvStream is null.

    ArgumentOutOfRangeException

    Thrown when bufferSize is not greater than zero.

    ArgumentException

    Thrown when csvStream does not support reading (i.e., CanRead is false).

    | Improve this Doc View Source

    ProcessStreamAsync(Stream, CsvReaderVisitorBase, Int32, IProgress<Int32>, CancellationToken)

    Describes the contents of a CSV stream to the given instance of the CsvReaderVisitorBase class.

    Declaration
    [Obsolete("Use CsvAsyncInput.ForStream(csvStream).WithMinReadBufferByteCount(bufferSize).ProcessAsync(visitor, progress, cancellationToken).")]
    public static ValueTask ProcessStreamAsync(Stream csvStream, CsvReaderVisitorBase visitor, int bufferSize, IProgress<int> progress = null, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Stream csvStream

    The CSV stream to describe.

    CsvReaderVisitorBase visitor

    The CsvReaderVisitorBase instance to describe the stream to.

    Int32 bufferSize

    The length of the buffer to use (default: 81920).

    IProgress<Int32> progress

    An IProgress<T> that will be notified every time the next chunk of the stream is processed, with the size of the chunk (in bytes) that was processed.

    All notifications will receive values less than or equal to the buffer size in bytes (which, for this overload, is the value of bufferSize).

    There will be one last notification with value 0 after the entire stream has been processed and the final few stream elements have been consumed.

    This may be left as null if no progress notifications are needed.

    CancellationToken cancellationToken

    An instance of CancellationToken that may be used to signal that results are no longer needed, and so the method should terminate at its earliest convenience.

    This may be left as its default value of None if the operation does not need to support cancellation.

    Returns
    Type Description
    ValueTask
    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when csvStream is null.

    ArgumentOutOfRangeException

    Thrown when bufferSize is not greater than zero.

    ArgumentException

    Thrown when csvStream does not support reading (i.e., CanRead is false).

    OperationCanceledException

    Thrown (perhaps asynchronously) to acknowledge cancellation. A derived exception, such as TaskCanceledException, may also be thrown by the system.

    ObjectDisposedException

    Thrown (perhaps asynchronously) if the underlying CancellationTokenSource object backing cancellationToken is disposed before the asynchronous operation terminates.

    | Improve this Doc View Source

    ProcessStreamAsync(Stream, CsvReaderVisitorBase, IProgress<Int32>, CancellationToken)

    Describes the contents of a CSV stream to the given instance of the CsvReaderVisitorBase class.

    Declaration
    [Obsolete("Use CsvAsyncInput.ForStream(csvStream).ProcessAsync(visitor, progress, cancellationToken).")]
    public static ValueTask ProcessStreamAsync(Stream csvStream, CsvReaderVisitorBase visitor, IProgress<int> progress = null, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Stream csvStream

    The CSV stream to describe.

    CsvReaderVisitorBase visitor

    The CsvReaderVisitorBase instance to describe the stream to.

    IProgress<Int32> progress

    An IProgress<T> that will be notified every time the next chunk of the stream is processed, with the size of the chunk (in bytes) that was processed.

    All notifications will receive values less than or equal to the buffer size in bytes (which, for this overload, is the default value of 81,920).

    There will be one last notification with value 0 after the entire stream has been processed and the final few stream elements have been consumed.

    This may be left as null if no progress notifications are needed.

    CancellationToken cancellationToken

    An instance of CancellationToken that may be used to signal that results are no longer needed, and so the method should terminate at its earliest convenience.

    This may be left as its default value of None if the operation does not need to support cancellation.

    Returns
    Type Description
    ValueTask
    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when csvStream is null.

    ArgumentException

    Thrown when csvStream does not support reading (i.e., CanRead is false).

    OperationCanceledException

    Thrown (perhaps asynchronously) to acknowledge cancellation. A derived exception, such as TaskCanceledException, may also be thrown by the system.

    ObjectDisposedException

    Thrown (perhaps asynchronously) if the underlying CancellationTokenSource object backing cancellationToken is disposed before the asynchronous operation terminates.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX