Documentation ¶
Overview ¶
Microsoft Compound Document File Reference: https://www.openoffice.org/sc/compdocfileformat.pdf ERRATA: The above document says the 0th sector is always 512 bytes into the file. This is not correct. If SectorSize > 512 bytes then the 0th sector is SectorSize bytes into the file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComDoc ¶
type ComDoc struct { File io.ReaderAt Header *Header SectorSize int ShortSectorSize int FirstSector int64 // MSAT is a list of sector IDs holding a SAT MSAT []SecID // SAT is a table where the index is the sector ID and the value is a pointer to the next sector ID in the same stream SAT []SecID SSAT []SecID Files []DirEnt // contains filtered or unexported fields }
CDF file open for reading or writing
func (*ComDoc) AddFile ¶
Add or replace a named stream with the given contents. Only streams within the root storage are currently supported.
func (*ComDoc) Close ¶
Close the CDF and, if open for writing, commit the remainder of structures to disk.
func (*ComDoc) DeleteFile ¶
Delete a file from the root storage if it exists
func (*ComDoc) ReadStream ¶
Open a stream for reading
func (*ComDoc) RootStorage ¶
Return a pointer to the root storage.
type DirEnt ¶
type DirEnt struct { RawDirEnt // Index into the directory stream holding this entry Index int // contains filtered or unexported fields }
Parsed CDF directory entry
type Header ¶
type Header struct { Magic [8]byte UID [16]byte Revision uint16 Version uint16 ByteOrder uint16 SectorSize uint16 // power of 2 ShortSectorSize uint16 // power of 2 Reserved1 [6]byte DirSectorCount uint32 // undocumented? SATSectors uint32 DirNextSector SecID Reserved2 uint32 MinStdStreamSize uint32 SSATNextSector SecID SSATSectorCount uint32 MSATNextSector SecID MSATSectorCount uint32 MSAT [msatInHeader]SecID }
Raw CDF file header
type RawDirEnt ¶
type RawDirEnt struct { NameRunes [32]uint16 NameLength uint16 Type DirType Color Color LeftChild int32 RightChild int32 StorageRoot int32 UID [16]byte UserFlags uint32 CreateTime uint64 ModifyTime uint64 NextSector SecID StreamSize uint32 // contains filtered or unexported fields }
Raw CDF directory entry