| Crates.io | inf-rs |
| lib.rs | inf-rs |
| version | 0.2.0 |
| created_at | 2025-03-03 03:39:06.810761+00 |
| updated_at | 2025-06-12 05:54:10.905639+00 |
| description | INF file parse library |
| homepage | |
| repository | https://github.com/krishnakumar4a4/inf-rs |
| max_upload_size | |
| id | 1575087 |
| size | 84,193 |
This is a Windows INF file parser library. Supports UTF-8 & UTF16-LE formats of INF files.
Add this to your Cargo.toml:
[dependencies]
inf-rs = "0.1.0"
log = "0.4.20"
env_logger = "0.10.1" # Optional, for logging configuration
Basic usage example:
use inf_rs::WinInfFile;
use std::path::PathBuf;
use env_logger::Env;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize the logger (optional)
env_logger::Builder::from_env(Env::default().default_filter_or("debug")).init();
let mut inf_file = WinInfFile::default();
inf_file.parse(PathBuf::from("path/to/file.inf"))?;
// Access sections
for (section_name, section) in inf_file.sections.iter() {
println!("Section: {}", section_name);
for entry in §ion.entries {
match entry {
InfEntry::KeyValue(key, value) => {
println!(" {} = {:?}", key, value);
}
InfEntry::OnlyValue(value) => {
println!(" {:?}", value);
}
}
}
}
Ok(())
}
The library uses the log crate for debug logging. To see debug messages, you can:
env_logger as shown in the example aboveRUST_LOG environment variable to debug or traceThis project is licensed under the MIT License - see the LICENSE file for details.