Giter Club home page Giter Club logo

ini-parser's Introduction

INI File Parser

A Mono-compatible .NET library for reading/writing INI data from IO streams, file streams, and strings.

Build Status

Installation

The library is published to NuGet and can be installed on the command-line from the directory containing your solution.

> nuget install ini-parser

Or, from the Package Manager Console in Visual Studio

PM> Install-Package ini-parser

Or from the NuGet Package Manager extension built available for most flavors of Visual Studio!

Getting Started

INI data is stored in nested dictionaries, so accessing the value associated to a key in a section is straightforward. Load the data using one of the provided methods.

var data = parser.ReadFile("Configuration.ini");

Retrieve the value for a key inside of a named section. Values are always retrieved as strings.

var useFullScreen = data["UI"]["fullscreen"];

Modify the value in the dictionary, not the value retrieved, and save to a new file or overwrite.

data["UI"]["fullscreen"] = "true";
parser.WriteFile("Configuration.ini", data);

See the wiki for more usage examples.

## Contributing

Do you have an idea to improve this library, or did you happen to run into a bug. Please share your idea or the bug you found in the issues page, or even better: feel free to fork and contribute to this project!

Version 2.0!

Since the INI format isn't really a "standard", this version introduces a simpler way to customize INI parsing:

  • Pass a configuration object to an IniParser, specifying the behaviour of the parser. A default implementation is used if none is provided.

  • Derive from IniDataParser and override the fine-grained parsing methods.

ini-parser's People

Contributors

anthonymastrean avatar hagish avatar kzgs avatar rickyah avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.