yini_rs/lib.rs
1//! # YINI-RS
2//!
3//! A Rust implementation of the YINI (YAML-like INI) format parser and writer.
4//!
5//! YINI is a configuration file format that combines the simplicity of INI files
6//! with some features from YAML, including:
7//! - Nested sections using caret (^) notation
8//! - Multiple data types (strings, integers, floats, booleans, arrays)
9//! - Comments (both line and block comments)
10//! - Type coercion and conversion
11//!
12//! ## Example
13//!
14//! ```rust
15//! use yini_rs::Parser;
16//!
17//! let mut parser = Parser::new();
18//! parser.parse_string(r#"
19//! name = 'My App'
20//! version = 1.0
21//! debug = true
22//!
23//! ^ database
24//! host = 'localhost'
25//! port = 5432
26//! "#)?;
27//!
28//! // Access values
29//! assert_eq!(parser.root()["name"].as_string()?, "My App");
30//! assert_eq!(parser.root()["version"].as_double()?, 1.0);
31//! assert_eq!(parser.root().get_section("database")?["port"].as_int()?, 5432);
32//! # Ok::<(), Box<dyn std::error::Error>>(())
33//! ```
34
35pub mod error;
36pub mod value;
37pub mod section;
38pub mod parser;
39
40#[cfg(test)]
41mod tests;
42
43pub use error::{Error, Result, ParseError, FileError};
44pub use value::Value;
45pub use section::Section;
46pub use parser::Parser;