Git Product home page Git Product logo

pikinni's Introduction

Pikinni - INI File Handler for .NET

Overview

Pikinni is a lightweight .NET library designed to manipulate and handle INI files. This library allows easy access to INI file sections and properties, supporting operations likereading, modifying, and saving configurations.

Features

  • Load INI Files: Directly load INI files from a file path.
  • Access Settings: Retrieve global settings and settings within named sections.
  • Dynamic Configuration: Update and manage settings dynamically during runtime.
  • Iterate Sections: Easily iterate through all sections and their respective properties.

Getting Started

Installation

Clone this repository to your machine and include the source code in your .NET projects.

Usage

Loading an INI File

Here's how you can use Pikinni to load an INI file and access its contents:

using Pikinni;

// Load an INI file
Ini myIni = Ini.LoadFromFile("path_to_your_ini_file.ini");

// Access a global property
string globalValue = myIni.Global["propertyName"];

// Access a property from a specific section
string sectionValue = myIni["SectionName"]["propertyName"];

Note: Properties which don't exist return empty string.

Creating and Saving a New INI File

Ini myNewIni = new Ini();
myNewIni.Global["newGlobalProperty"] = "value1";
myNewIni["NewSection"]["newProperty"] = "value2";

// Print the INI content
Console.WriteLine(myNewIni.ToString());

// Save the new INI file
myNewIni.SaveToFile("MyNew.ini");

Note: Comments in the original INI file are not preserved during parsing.

Iterating Through Sections

foreach (Ini.Section section in myIni)
{
    Console.WriteLine($"Section: {section.Name}");
    foreach (var property in section.Properties)
    {
        Console.WriteLine($"Property: {property.Key}, Value: {property.Value}");
    }
}

Contributing

If you have any ideas, bug reports, or enhancements, please feel free to fork the repository, make changes, and submit a pull request. You can also create an issue to discuss modifications or additional features.

License

See LICENSE.txt.

pikinni's People

Contributors

thesigns avatar

Stargazers

 avatar

Watchers

 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.