Giter Club home page Giter Club logo

unifiedconfig's Introduction

UnifiedConfig

A common C# class to manipulate xml, ini and json config files with unified interfaces.

Version Downloads

Features

  • Wrapped the difference among xml, ini and json, you can access the config file without the consideration of format.
  • Provide XPath as default locating method.
  • Saving file will not change the original format.

Usage

Recommend nuget package

Install-Package UnifiedConfig

OR

  1. compile the class library and add reference of the dlls including the "UnifiedConfig.dll" to your project.
  2. add using statement to your namespaces.
  3. you can call the functions by using the following code or just read the test class.
ConfigManager config = new ConfigManager("test.ini");
Assert.Equal("5", config[@"//Default/Interval"]);

alternatively, you can directly start a project from the solution. By adding a new project into the solution, you can easily make use of the class. A unittest project is provided.

Roadmap

Issues and PRs are welcomed.

  • Support for json
  • Nuget package
  • Auto-inference the type of config file without extension detection
  • Support returning more types other than string (via ToObject method)
  • Support of IEnumerable for sophisticated query
  • Support for int indexer is removed since the xpath supported already
  • Ready to go template project
  • Case-sensitive swtich for path matching
  • Return null other than throwing error if xpath not exist

Update Notes

UPDATE 2020/06/05: Return null if xpath not exists.

UPDATE 2017/07/29: Add Case-sensitive swtich for path matching

UPDATE 2017/07/25: Add Name property and fix the IEnumerable bug.

UPDATE 2017/07/24: Add IEnumerable support for sophisticated query.

UPDATE 2017/07/22: Add Auto-inference and type conversion.

UPDATE 2017/07/20: Add json support.

UPDATE 2017/07/18: Nuget package supported.

unifiedconfig's People

Contributors

circler3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

unifiedconfig's Issues

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.