Vue de l’ensemble
‘CfbReader’ est un parzer de bas niveau, seulement lisible pour les fichiers binaires Compound File. Construisez-le via ‘FromFile’ ou ‘FromStream’, puis navigez sur l’arbre de directoire avec ‘IterStorages’, ‘IterStreams’, `Itchildren’ et ’ FindChildByName’. Utilisez ‘GetStreumData’ pour lire des bytes crus d’un courant appelé. Implémentations ‘IDisposable’; utilisez toujours dans un bloc ‘utiliser’ afin de libérer les manuels de fichier.
constructeurs
| Signature | Description |
|---|
CfbReader(data: byte[]) | Creates a new CfbReader with the specified parameters. |
méthodes
| Signature | Description |
|---|
FromFile(path: string) | Opens the CFB file at path and returns a new CfbReader. |
FromStream(stream: Stream) | Reads a CFB file from stream and returns a new CfbReader. |
Dispose() | Releases any file handle or stream held by this reader. |
GetEntry(streamId: uint) | Returns the DirectoryEntry for the given streamId. |
GetStreamData(streamId: uint) | Returns the raw byte content of the stream identified by streamId. |
IterStorages() | Yields all storage-type directory entries in tree order. |
IterStreams() | Yields all stream-type directory entries in tree order. |
IterChildren(storageStreamId: uint) | Yields direct child entries of the storage identified by storageStreamId. |
IterTree(startStreamId: uint) | Yields all entries in the subtree rooted at startStreamId (depth-first). |
FindChildByName(storageStreamId: uint, name: string) | Returns the stream ID of the direct child of storageStreamId whose name equals name, or null if not found. |
ResolvePath(names: IEnumerable<string>, startStreamId: uint) | Walks a sequence of names starting from startStreamId and returns the stream ID of the final entry. |
Propriétés
| Name | Type | Access | Description |
|---|
Header | Header | Read | The parsed CFB file header; exposes sector-size fields. |
Difat | ReadOnlyCollection<uint> | Read | Read-only view of the DIFAT sector chain. |
Fat | ReadOnlyCollection<uint> | Read | Read-only view of the FAT (file allocation table) sector chain. |
MiniFat | ReadOnlyCollection<uint> | Read | Read-only view of the FAT (file allocation table) sector chain. |
DirectoryEntries | ReadOnlyCollection<DirectoryEntry> | Read | All 128-byte directory entries parsed from the directory sectors, in raw order. |
RootEntry | DirectoryEntry | Read | The root directory entry (stream ID 0). |
MiniStream | byte[] | Read | Raw bytes of the mini-stream container (the data stream of the root entry). |
MajorVersion | int | Read | CFB major version parsed from the file header. |
SectorSize | int | Read | Sector size in bytes (512 for v3, 4096 for v4). |
MiniSectorSize | int | Read | Sector size in bytes (512 for v3, 4096 for v4). |
DirectoryEntryCount | int | Read | Total number of directory entry records in the directory sectors. |
MaterializedStreamCount | int | Read | Number of streams with non-empty data in the parsed document. |
FileSize | int | Read | Total size of the source file or stream in bytes. |
Voir aussi