pub struct AltiumCfb<R: Read + Seek> { /* private fields */ }Expand description
Wrapper around CFB providing Altium-specific convenience methods.
This is Layer 1 of the API, providing low-level access to the CFB container with helpers for reverse engineering and exploration.
Implementations§
Source§impl<R: Read + Seek> AltiumCfb<R>
impl<R: Read + Seek> AltiumCfb<R>
Sourcepub fn file_type(&self) -> AltiumFileType
pub fn file_type(&self) -> AltiumFileType
Returns the detected file type.
Sourcepub fn streams(&mut self) -> Result<Vec<StreamInfo>>
pub fn streams(&mut self) -> Result<Vec<StreamInfo>>
Lists all streams in the CFB container.
Sourcepub fn storages(&mut self) -> Result<Vec<StorageInfo>>
pub fn storages(&mut self) -> Result<Vec<StorageInfo>>
Lists all storages (directories) in the CFB container.
Sourcepub fn section_keys(&mut self) -> Result<&HashMap<String, String>>
pub fn section_keys(&mut self) -> Result<&HashMap<String, String>>
Loads and caches section keys mapping (LIBREF → storage path).
Section keys map full component names to truncated storage paths, which is necessary because CFB has a 31-character limit on entry names.
Sourcepub fn resolve_section(&mut self, lib_ref: &str) -> Result<String>
pub fn resolve_section(&mut self, lib_ref: &str) -> Result<String>
Resolves a component/footprint name to its storage path.
For names ≤31 chars without ‘/’, returns the name directly. For longer names or names with ‘/’, looks up in section keys.
Sourcepub fn list_components(&mut self) -> Result<Vec<String>>
pub fn list_components(&mut self) -> Result<Vec<String>>
Lists all component/footprint names in a library file.
Sourcepub fn read_params(&mut self, path: &str) -> Result<ParameterCollection>
pub fn read_params(&mut self, path: &str) -> Result<ParameterCollection>
Reads a stream and parses it as a single ParameterCollection.
Sourcepub fn read_blocks(&mut self, path: &str) -> Result<Vec<Block>>
pub fn read_blocks(&mut self, path: &str) -> Result<Vec<Block>>
Reads a stream as size-prefixed blocks.
Sourcepub fn parse_blocks(data: &[u8]) -> Result<Vec<Block>>
pub fn parse_blocks(data: &[u8]) -> Result<Vec<Block>>
Parses raw data as size-prefixed blocks.
Sourcepub fn decompress(&mut self, path: &str) -> Result<Vec<u8>>
pub fn decompress(&mut self, path: &str) -> Result<Vec<u8>>
Decompresses a zlib-compressed stream.
Sourcepub fn decompress_at(&mut self, path: &str, offset: usize) -> Result<Vec<u8>>
pub fn decompress_at(&mut self, path: &str, offset: usize) -> Result<Vec<u8>>
Decompresses data starting at a given offset.
Sourcepub fn hexdump(
&mut self,
path: &str,
offset: usize,
length: usize,
width: usize,
) -> Result<String>
pub fn hexdump( &mut self, path: &str, offset: usize, length: usize, width: usize, ) -> Result<String>
Generates a hexdump of stream content.
Sourcepub fn find_strings(
&mut self,
path: &str,
min_length: usize,
) -> Result<Vec<FoundString>>
pub fn find_strings( &mut self, path: &str, min_length: usize, ) -> Result<Vec<FoundString>>
Finds printable strings in a stream.
Sourcepub fn search(
&mut self,
pattern: &str,
ignore_case: bool,
) -> Result<Vec<SearchMatch>>
pub fn search( &mut self, pattern: &str, ignore_case: bool, ) -> Result<Vec<SearchMatch>>
Searches for a pattern across all streams.
Sourcepub fn inner(&mut self) -> &mut CompoundFile<R>
pub fn inner(&mut self) -> &mut CompoundFile<R>
Returns mutable access to the underlying CompoundFile.
Use this for advanced operations not covered by the wrapper.
Sourcepub fn inner_ref(&self) -> &CompoundFile<R>
pub fn inner_ref(&self) -> &CompoundFile<R>
Returns immutable access to the underlying CompoundFile.
Sourcepub fn entry_type(&mut self, path: &str) -> Option<bool>
pub fn entry_type(&mut self, path: &str) -> Option<bool>
Checks if a path exists and returns whether it’s a stream.
Returns Some(true) if the path is a stream, Some(false) if it’s a storage,
None if the path doesn’t exist.
Sourcepub fn stream_size(&mut self, path: &str) -> Option<u64>
pub fn stream_size(&mut self, path: &str) -> Option<u64>
Returns the size of a stream, or None if the path doesn’t exist or isn’t a stream.
Auto Trait Implementations§
impl<R> Freeze for AltiumCfb<R>
impl<R> RefUnwindSafe for AltiumCfb<R>
impl<R> Send for AltiumCfb<R>
impl<R> Sync for AltiumCfb<R>
impl<R> Unpin for AltiumCfb<R>
impl<R> UnwindSafe for AltiumCfb<R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more