[][src]Struct ovba::Project

pub struct Project {
    pub information: Information,
    pub references: Vec<Reference>,
    pub modules: Vec<Module>,
    // some fields omitted
}

Represents a VBA project.

This type serves as the entry point into this crate's functionality and exposes the public API surface.

Fields

information: Information

Specifies version-independent information for the VBA project.

references: Vec<Reference>

Specifies the external references of the VBA project.

modules: Vec<Module>

Specifies the modules in the project.

Implementations

impl Project[src]

pub fn decompress_stream_from<P>(
    &self,
    stream_path: P,
    offset: usize
) -> Result<Vec<u8>> where
    P: AsRef<Path>, 
[src]

Returns a stream's decompressed data.

This function reads a stream referenced by stream_path and passes the data starting at offset into the RLE decompressor.

The primary use case for this function is to extract source code from VBA Modules. The respective offset is reported by Module::text_offset.

This is a low-level function that is useful for very specific use cases only. Client code that needs to read source code should use Project::module_source or Project::module_source_raw instead.

pub fn list(&self) -> Result<Vec<(String, String)>>[src]

Returns a list of entries (storages and streams) in the raw binary data. Each entry is represented as a tuple of two Strings, where the first element contains the entry's name and the second element the entry's path inside the CFB.

The raw binary data is encoded as a Compound File Binary

pub fn module_source(&self, name: &str) -> Result<String>[src]

Returns a module's source code.

Similar to Project::module_source_raw this function returns the source code of a project's module. After the raw source code has been decoded it is then converted to a String using the project's code page.

pub fn module_source_raw(&self, name: &str) -> Result<Vec<u8>>[src]

Returns the raw source code from a module.

The result contains a module's source code as is. No character encoding conversion is done. The data is encoded using the project's code page available through Information::code_page.

pub fn read_stream<P>(&self, stream_path: P) -> Result<Vec<u8>> where
    P: AsRef<Path>, 
[src]

Returns a stream's contents.

This is a low-level function operating on the CFB data. The CFB is the storage container of the raw binary VBA project.

Auto Trait Implementations

impl !RefUnwindSafe for Project

impl Send for Project

impl !Sync for Project

impl Unpin for Project

impl UnwindSafe for Project

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.