Struct cfb::CompoundFile
[−]
[src]
pub struct CompoundFile<F> { /* fields omitted */ }
Methods
impl<F> CompoundFile<F>
[src]
fn version(&self) -> Version
[src]
Returns the CFB format version used for this compound file.
fn root_entry(&self) -> Entry
[src]
Returns information about the root storage object. This is equivalent
to self.entry("/").unwrap()
(but always succeeds).
fn entry<P: AsRef<Path>>(&self, path: P) -> Result<Entry>
[src]
Given a path within the compound file, get information about that stream or storage object.
fn read_storage<P: AsRef<Path>>(&self, path: P) -> Result<Entries>
[src]
Returns an iterator over the entries within a storage object.
fn walk_storage<P: AsRef<Path>>(&self, path: P) -> Result<Entries>
[src]
Returns an iterator over all entries under a storage subtree, including the given path itself. The iterator walks the storage tree in a preorder traversal.
fn exists<P: AsRef<Path>>(&self, path: P) -> bool
[src]
Returns true if there is an existing stream or storage at the given path, or false if there is nothing at that path.
fn is_stream<P: AsRef<Path>>(&self, path: P) -> bool
[src]
Returns true if there is an existing stream at the given path, or false if there is a storage or nothing at that path.
fn is_storage<P: AsRef<Path>>(&self, path: P) -> bool
[src]
Returns true if there is an existing storage at the given path, or false if there is a stream or nothing at that path.
fn into_inner(self) -> F
[src]
Consumes the CompoundFile
, returning the underlying reader/writer.
impl<F: Seek> CompoundFile<F>
[src]
fn open_stream<P: AsRef<Path>>(&mut self, path: P) -> Result<Stream<F>>
[src]
Opens an existing stream in the compound file for reading and/or writing (depending on what the underlying file supports).
impl<F: Read + Seek> CompoundFile<F>
[src]
fn open(inner: F) -> Result<CompoundFile<F>>
[src]
Opens an existing compound file, using the underlying reader. If the
underlying reader also supports the Write
trait, then the
CompoundFile
object will be writable as well.
impl<F: Read + Write + Seek> CompoundFile<F>
[src]
fn create(inner: F) -> Result<CompoundFile<F>>
[src]
Creates a new compound file with no contents, using the underlying reader/writer. The reader/writer should be initially empty.
fn create_with_version(version: Version, inner: F) -> Result<CompoundFile<F>>
[src]
Creates a new compound file of the given version with no contents, using the underlying writer. The writer should be initially empty.
fn create_storage<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Creates a new, empty storage object (i.e. "directory") at the provided path. The parent storage object must already exist.
fn create_storage_all<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Recursively creates a storage and all of its parent storages if they are missing.
fn remove_storage<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Removes the storage object at the provided path. The storage object must exist and have no children.
fn remove_storage_all<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Recursively removes a storage and all of its children. If called on the root storage, recursively removes all of its children but not the root storage itself (which cannot be removed).
fn set_storage_clsid<P: AsRef<Path>>(
&mut self,
path: P,
clsid: Uuid
) -> Result<()>
[src]
&mut self,
path: P,
clsid: Uuid
) -> Result<()>
Sets the CLSID for the storage object at the provided path. (To get
the current CLSID for a storage object, use
self.entry(path)?.clsid()
.)
fn create_stream<P: AsRef<Path>>(&mut self, path: P) -> Result<Stream<F>>
[src]
Creates and returns a new, empty stream object at the provided path. If a stream already exists at that path, it will be replaced by the new stream. The parent storage object must already exist.
fn create_new_stream<P: AsRef<Path>>(&mut self, path: P) -> Result<Stream<F>>
[src]
Creates and returns a new, empty stream object at the provided path. Returns an error if a stream already exists at that path. The parent storage object must already exist.
fn remove_stream<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Removes the stream object at the provided path.
fn set_state_bits<P: AsRef<Path>>(&mut self, path: P, bits: u32) -> Result<()>
[src]
Sets the user-defined bitflags for the object at the provided path.
(To get the current state bits for an object, use
self.entry(path)?.state_bits()
.)
fn touch<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Sets the modified time for the object at the given path to now. Has no effect when called on the root storage.
fn flush(&mut self) -> Result<()>
[src]
Flushes all changes to the underlying file.