Git Product home page Git Product logo

ini_core's People

Contributors

casualx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ini_core's Issues

Round tripping INI-parser?

Hi,

I'm in need of a round tripping (i.e. not reformatting on save) INI-parser to be able to semantically patch arbitrary INI-files. This library looks like the closest existing one to my needs for Rust (if I keep the auto trim turned off). However it does have some limitations that I'm wondering if you are interested in addressing / accepting patches from me to address (or if I should just take this project as a basis/inspiration to make my own thing):

  • Non-UTF-8: I don't know the encoding of the files I will be working with. Probably UTF-8 almost always, but that is not something I can assume in general. An alternative [u8] API would be more suitable for me.
  • I don't know the comment symbol in the file in advance (I would like to accept both # and ; at least). Supporting a set of comment symbols would be something I need.
  • Support for dealing with "strange" non-standard INI data. Since I'm dealing with arbitrary INI files from arbitrary programs, here are some of the weirdness I have seen and need to do something sensible on:
    • Key & values before the first section
    • "Silly" sections like [section][subsection][3] or [section[32]]
    • Weird keys like AnimationSpeed[$d] (This one is from a KDE ini file)
  • As I said, I need to be able to round trip things without reformatting, so whitespace must be preserved regardless of position. This includes telling key = value apart from key=value (currently already supported), as well as dealing with trailing whitespaces and blank lines (not sure if this is preserved currently?). From what I can tell, this library with auto-trim turned off is most of the way there, though I have not yet tested it fully.

The reason I need this is that I'm planning on rewriting this project in Rust (instead of Python) for performance reasons. In that case I had to roll my own ini parser, as Python didn't have what I needed either.

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.