3 releases
new 0.1.4 | Apr 5, 2025 |
---|---|
0.1.3 |
|
0.1.2 | Apr 5, 2025 |
0.1.1 | Apr 3, 2025 |
0.1.0 |
|
#22 in #section
67 downloads per month
11KB
183 lines
gerbil-ini
Simple no-std compatible .ini parsing library.
Example usage
use gerbil_ini::{Ini, IniMode};
let some_ini = r#"
; This is a comment.
[My Section]
; Here's a value
some KEY=This is a value!
; Here's another value
anotherkey=This is yet another value!
;commented out=this value isn't real :(
[Another Section]
yourkey=This is a value!
some KEY=This, too, is a value!
anotherkey=//Wow Look At Me I'm A Value\\
"#;
let ini = Ini::parse(some_ini, IniMode::Simple).expect("parse");
let section = ini.get_section("My Section").unwrap();
assert_eq!(section.get("some KEY"), Some("This is a value!"));
assert_eq!(ini.get_value("Another Section", "anotherkey"), Some("//Wow Look At Me I'm A Value\\\\"));