INIp

:pencil: An INI parser library written in Rust.

Summary

  1. Features
  2. Installation
  3. Examples
  4. Rules
  5. Contributions
  6. License

Features

| Feature | Implemented? | |----------------------------|--------------------| | Sections support | :heavycheckmark: | | Disabled entry recognition | :heavycheckmark: | | Section nesting support | :x: | | Multi-line support | :x: |

Installation

Add this to your Cargo.toml:

inip = "0.2.5"

Example

ini ; file.ini [section] full_name = "Hicaro"

```rust use inip::parser::Parser;

fn main() { let parsedfile = Parser::parse("file.ini").unwrap(); asserteq!(parsedfile["section"]["fullname"], "Hicaro".to_string()); } ```

You can read valid and invalid examples on examples.

Rules

  1. Comment lines start with ; ```ini ; this is a comment

    this is not a comment

    ```

  2. All values must be surrounded by quotes

    Valid: ini [section] name = "John Doe"

    Invalid: ini [section] name = John Doe

  3. All key names must have one word

    Valid: ini [credentials] full_name = "John Doe"

    Invalid: ini [credentials] full name = "John Doe"

    If you want multiple words on your key name, use whatever style you want, but don't use space to separate that.

  4. Disable entry recognition by using ;

    ini [credentials] ; full_name = "John Doe"

Contributions

If you find any problems with this library, please let me know by opening an issue explaining the problem.

License

This project is licensed under the MIT license.