fffca3d205
This utility is intended to support the extension packages that are siblings of this package, along with third-party extensions, by providing a way to transform bodies in arbitrary ways. The "Deep" function then provides a means to apply a particular transform recursively to a nested block tree, allowing a particular extension to be supported at arbitrary nesting levels. This functionality is provided in terms of the standard zcl.Body interface, so that transform results can be used with any code that operates generically on bodies. This includes the zcldec and gozcl packages, so files with extensions can still be decoded in the usual way.
8 lines
358 B
Go
8 lines
358 B
Go
// Package transform is a helper package for writing extensions that work
|
|
// by applying transforms to bodies.
|
|
//
|
|
// It defines a type for body transformers, and then provides utilities in
|
|
// terms of that type for working with transformers, including recursively
|
|
// applying such transforms as heirarchical block structures are extracted.
|
|
package transform
|