Search Results for

    Show / Hide Table of Contents

    Class StreamParser

    Incrementally emits complete top-level Links Notation records.

    Inheritance
    object
    StreamParser
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Link.Foundation.Links.Notation
    Assembly: Link.Foundation.Links.Notation.dll
    Syntax
    public sealed class StreamParser

    Constructors

    | Edit this page View Source

    StreamParser()

    Creates a stream backed by a default canonical parser.

    Declaration
    public StreamParser()
    | Edit this page View Source

    StreamParser(Parser)

    Creates a stream backed by parser.

    Declaration
    public StreamParser(Parser parser)
    Parameters
    Type Name Description
    Parser parser

    Properties

    | Edit this page View Source

    Collect

    Whether emitted links are retained for Finish() and Drain().

    Declaration
    public bool Collect { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    MaxBufferSize

    The largest unresolved record accepted by the stream.

    Declaration
    public int MaxBufferSize { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Position

    The point immediately after the last character written.

    Declaration
    public StreamPosition Position { get; }
    Property Value
    Type Description
    StreamPosition

    Methods

    | Edit this page View Source

    Drain()

    Returns and forgets links retained since the previous call.

    Declaration
    public IReadOnlyList<Link<string>> Drain()
    Returns
    Type Description
    IReadOnlyList<Link<string>>
    | Edit this page View Source

    Finish()

    Finishes the stream and returns all undrained links.

    Declaration
    public IReadOnlyList<Link<string>> Finish()
    Returns
    Type Description
    IReadOnlyList<Link<string>>
    | Edit this page View Source

    Finish(string)

    Consumes a final chunk and finishes the stream.

    Declaration
    public IReadOnlyList<Link<string>> Finish(string chunk)
    Parameters
    Type Name Description
    string chunk
    Returns
    Type Description
    IReadOnlyList<Link<string>>
    | Edit this page View Source

    ParseChunks(IEnumerable<string>, Parser?)

    Lazily parses a sequence of chunks as a native enumerable.

    Declaration
    public static IEnumerable<Link<string>> ParseChunks(IEnumerable<string> chunks, Parser? parser = null)
    Parameters
    Type Name Description
    IEnumerable<string> chunks
    Parser parser
    Returns
    Type Description
    IEnumerable<Link<string>>
    | Edit this page View Source

    ParseChunksAsync(IAsyncEnumerable<string>, Parser?, CancellationToken)

    Lazily parses an asynchronous sequence of chunks.

    Declaration
    public static IAsyncEnumerable<Link<string>> ParseChunksAsync(IAsyncEnumerable<string> chunks, Parser? parser = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    IAsyncEnumerable<string> chunks
    Parser parser
    CancellationToken cancellationToken
    Returns
    Type Description
    IAsyncEnumerable<Link<string>>
    | Edit this page View Source

    Reset()

    Reuses the parser while preserving its options and event handlers.

    Declaration
    public StreamParser Reset()
    Returns
    Type Description
    StreamParser
    | Edit this page View Source

    Write(string)

    Consumes a chunk and returns links made complete by it.

    Declaration
    public IReadOnlyList<Link<string>> Write(string chunk)
    Parameters
    Type Name Description
    string chunk
    Returns
    Type Description
    IReadOnlyList<Link<string>>

    Events

    | Edit this page View Source

    LinkParsed

    Raised once for every completed link.

    Declaration
    public event Action<Link<string>>? LinkParsed
    Event Type
    Type Description
    Action<Link<string>>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX