Documentation
¶
Overview ¶
Package embed finds the objects a file of the three formats embeds as storages of its compound file, and hands each on as a file of its own.
A Word file keeps its objects in the storage ObjectPool, one storage each; a workbook keeps them at its root, in storages named MBD and eight digits. What such a storage holds is one of:
- a file in a stream: "\x01Ole10Native" (a file of any kind, wrapped by the object packager, or the bytes of the program that made the object), "Package" (an Office Open XML file) or "CONTENTS" (what the embedding program wrote, a PDF for one). The bytes are handed on as they are.
- a compound document: the streams of a Word, Excel or PowerPoint file, or of any other program that stores in compound files. The storage is written out as a compound file of its own.
- a link to a file outside: counted, and not followed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Object ¶
type Object struct {
// Path is the storage's path from the root.
Path []string
// Link says the object is a link to a file outside, by the flag of
// its "\x01Ole" stream ([MS-OLEDS] 2.3.3) or, in a workbook, by its
// storage's name.
Link bool
}
Object is an embedded object: a storage of the file.
type Result ¶
type Result struct {
Children []*gofastcore.Document
// Links counts the objects that are links to files outside.
Links int
// Damaged names the objects that could not be read.
Damaged []string
// Deep counts the objects whose storages nest too deep to write out.
Deep int64
// Limited says the decode budget ran out: the objects from there on
// are listed and not read.
Limited bool
}
Result is what Hand gives.
func Hand ¶
func Hand(ctx context.Context, f *cfb.File, opts *gofastcore.Options, objects []Object, read bool) Result
Hand hands the embedded objects to the caller's child extractor. With no child extractor, or with read false, each is listed without being read. What is handed on is taken from the decode budget in ctx.