Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LastResult

A consumer for the span parser that handles any match and only holds on to the last pointer

Hierarchy

  • LastResult

Implements

Index

Constructors

constructor

  • Create a LastResult consumer

    Parameters

    • splitStructures: JSONPointerMap

      a pointer map that will be filled with any split structures found in the matching data

    Returns LastResult

Properties

Private last

The last JSON pointer found

Private lastLength

lastLength: number

The number of bytes of of the last piece of data in the buffer

Private lastStart

lastStart: number

The starting position of the last piece of data in the buffer

Private Readonly splitStructures

splitStructures: JSONPointerMap

Any split structures found in the matching data

Methods

accept

  • accept(pointer: JSONPointer, start: number, length: number): void
  • Accept a JSON pointer found

    Parameters

    • pointer: JSONPointer

      the JSON pointer

    • start: number

      the starting position in the buffer

    • length: number

      the number of bytes in the buffer

    Returns void

consumeLast

  • Pass the last pointer to the delegate consumer

    Parameters

    Returns void

foundLast

  • foundLast(): boolean
  • Check if a last pointer has been found

    Returns boolean

    true if accept has been called with a JSON pointer

splitStructureEnd

  • splitStructureEnd(pointer: JSONPointer, count: number, start: number, length: number): void
  • Signal the end of a split structure

    Parameters

    • pointer: JSONPointer

      the JSON pointer

    • count: number

      the number of tokens in the split structure

    • start: number

      the starting position in the buffer

    • length: number

      the number of bytes in the buffer

    Returns void

Copyright © 2025 DiffusionData Ltd. All Rights Reserved.