Skip to content

Annotated hex callback #237

@davaya

Description

@davaya

Things to check first

  • I have searched the existing issues and didn't find my feature already requested there

Feature description

Please add the ability to register a visitor callback for each invocation and return of the parser or serializer.

Use case

This would allow the callback function to record the type, its stack depth, and its position in the byte stream, enabling generation of the "Annotated hex" view of a CBOR blob:

Hex:
82A1011901F4C077313938352D30342D31325432333A32303A35302E35325A

Annotated Hex:

82                                      # array(2)
   A1                                   # map(1)
      01                                # unsigned(1)
      19 01F4                           # unsigned(500)
   C0                                   # tag(0)
      77                                # text(23)
         313938352D30342D31325432333A32303A35302E35325A # "1985-04-12T23:20:50.52Z"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions