lua-toml icon indicating copy to clipboard operation
lua-toml copied to clipboard

ability to parse from file?

Open AKST opened this issue 9 years ago • 3 comments

Hey, I'm wondering how much modification would be required to enable this library to parse input from a file? Because at the moment it looks like you would need to load an entire file into memory to parse it, where as it could be more efficiently handled via reading a file with a fix sized buffer, this way memory usage would be constant (with the exception of building the TOML data structure).

For my purposes, I think reading the file into memory I can live with, but it's something I'd prefer not to have to do.

AKST avatar Aug 15 '16 11:08 AKST

This is an excellent idea, and something I wasn't thinking about when writing the library.

Unfortunately, that also means it will take a bit of refactoring to get it to work. Thankfully I don't think it will require too much! It's just not a quick and easy patch.

I'm labelling this as an enhancement but now that TOML 0.4.0 is supported, there isn't a lot left to work on, so hopefully I can get this working soon. As always, contributions are welcome.

jonstoler avatar Aug 16 '16 00:08 jonstoler

Unfortunately, that also means it will take a bit of refactoring to get it to work. Thankfully I don't think it will require too much! It's just not a quick and easy patch.

I'd be willing to help where I can if you can offer some guidance on a recommended approach to refactoring

AKST avatar Aug 17 '16 06:08 AKST

so hopefully I can get this working soon

Hi and thank you for this library, do you have a branch to switch git on, to rich this new feature ? I'm thinking same than @AKST that, if you can offer some guidance on a recommended approach i should try to help with that.

jerome-diver avatar Jan 08 '21 12:01 jerome-diver