altium_format/api/mod.rs
1//! Multi-layer API for Altium file access.
2//!
3//! This module provides a layered architecture for working with Altium files:
4//!
5//! - **Layer 1 (CFB)**: Low-level CFB wrapper with reverse engineering helpers
6//! - **Layer 2 (Generic)**: Dynamic record access without type knowledge
7//! - **Layer 3 (Typed)**: Strongly-typed access with derive macros
8//!
9//! # Quick Start
10//!
11//! ```ignore
12//! use altium_format::api::AltiumDocument;
13//!
14//! // Open any Altium file
15//! let mut doc = AltiumDocument::open("library.SchLib")?;
16//!
17//! // Layer 1: CFB access
18//! for stream in doc.cfb().streams()? {
19//! println!("{}: {} bytes", stream.path, stream.size);
20//! }
21//!
22//! // Layer 2: Generic access
23//! let container = doc.records("/Resistor/Data")?;
24//! for record in container.iter() {
25//! println!("{:?}", record.get("LIBREFERENCE"));
26//! }
27//!
28//! // Layer 3: Typed access
29//! let component: TypedAccessor<SchComponent> = doc.record_as("/Resistor/Data", 0)?;
30//! println!("Component: {}", component.lib_reference);
31//! ```
32
33mod cfb;
34mod document;
35pub mod generic;
36pub mod typed;
37pub mod views;
38
39pub use cfb::{AltiumCfb, AltiumFileType, Block, StorageInfo, StreamInfo};
40pub use document::AltiumDocument;
41pub use generic::{BinaryContainer, BinaryRecord, GenericRecord, ParamsContainer, Value};
42pub use typed::{EditTransaction, TypedAccessor};