skystrife / cpptoml

cpptoml is a header-only library for parsing TOML
MIT License
587 stars 133 forks source link

Mutate table values? #113

Closed cmaughan closed 5 years ago

cmaughan commented 5 years ago

Is it possible to load a toml file, edit a table value, and write the resulting data with the edit? This is for the scenario where a component knows only the parts of the configuration it wants to edit; and the rest of the file should be preserved. It looks to me like you can't find a table, modify a value. And adding a new table of the same name basically destroys the old table (I tried it)

cmaughan commented 5 years ago

Forget it, I realized you can just do get_table(), and insert, and it will replace just that item :)