Open Xirado opened 2 months ago
I need to dynamically traverse a toml file since i cannot deserialize the whole thing, but have not found a way to deserialize a TomlNode into a kotlinx Serializable class. Is it possible? If not, i think adding this functionality would be beneficial
Hey! Yes, we have a partial serialization. It is very easy
I think this is your scenario. Check this part in the readme
I think this is your scenario. Check this part in the readme
Yes, i read about this, but shouldn't there be a more efficient way? Every call will cause the whole file to be parsed again, which is very inefficient, TomlTable
already has all the information, so i think there should be a way to deserialize that aswell since it only requires reading the file once
Yes, i read about this, but shouldn't there be a more efficient way? Every call will cause the whole file to be parsed again, which is very inefficient,
TomlTable
already has all the information, so i think there should be a way to deserialize that aswell since it only requires reading the file once
Hm, may be I am getting this wrong, but if your file is changing dynamically and you re-read it again and again, then there anyway will be same parsing.
May be you can give some small example of the input and API, so we can implement it?
Yes, i read about this, but shouldn't there be a more efficient way? Every call will cause the whole file to be parsed again, which is very inefficient,
TomlTable
already has all the information, so i think there should be a way to deserialize that aswell since it only requires reading the file onceHm, may be I am getting this wrong, but if your file is changing dynamically and you re-read it again and again, then there anyway will be same parsing.
May be you can give some small example of the input and API, so we can implement it?
The file isn't changing, but i need to read the file as such
[a]
foo = "foo"
bar = "bar"
[b.a]
foo = "foo"
bar = "bar"
[b.b]
foo = "foo"
bar = "bar"
[x.y.z]
foo = "foo"
bar = "bar"
and then decode the file as such that i get Map<String, Foobar>
where the String represents the path, so e.g. x.y.z
And i already have the correct TomlTables i want to convert to Foobar, it's just that ktoml offers no way to do this conversion directly without using partial deserialization which is highly inefficient if you invoke it multiple times which is required here
I need to dynamically traverse a toml file since i cannot deserialize the whole thing, but have not found a way to deserialize a TomlNode into a kotlinx Serializable class. Is it possible? If not, i think adding this functionality would be beneficial