[−][src]Struct ovba::Project
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]
&self,
stream_path: P,
offset: usize
) -> Result<Vec<u8>> where
P: AsRef<Path>,
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
Module
s. 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 String
s, 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]
P: AsRef<Path>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,