User hook for command DUMP
Keywords: class-user

Next: Example Up: Adding hooks to the Previous: Adding hooks to the Contents

## User hook for command `DUMP`

The command `DUMP` displays the content of one or all sections of the R buffer. When CLASS finds a user section to dump, it can display the information it knows about each subsection. What it can not do is guessing what the `data` block contains.

If the section owner wants to tell CLASS how to `dump` its subsection, it has to:

1. tell CLASS which subsection it owns with `class_user_owner`. This is optional if it has been done elsewhere.
2. declare to CLASS with `class_user_dump` a subroutine which is able to display what is in the `data` block.

If CLASS tries now to `DUMP` the user section, it will loop over all the subsections it contains. If one matches the owner+title couple, it will put the `data` block in a specific place, and then call user's dump subroutine. This subroutine will then just have to translate back the `data` block to its own data type.

This last point must be fulfilled by a subroutine exactly symmetric to the transfer routine used at write time, i.e. elements should be reread in the same order they have been written.

Subsections

- Example
- API

Next: Example Up: Adding hooks to the Previous: Adding hooks to the Contents