Application: AnyOldName3

Join the team. This area is for people who want to participate in OpenMW's development in one way or another.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Application: AnyOldName3

Post by Zini »

Please note that openmw.cfg is parsed via boost program option. I guess these are limitations of that library. So the way around it would be to encode the problematic characters in a different way; for example like space can be encoded as %20 in an URL.
User avatar
AnyOldName3
Posts: 2676
Joined: 26 Nov 2015, 03:25

Re: Application: AnyOldName3

Post by AnyOldName3 »

Thanks. I'll get investigating.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Application: AnyOldName3

Post by scrawl »

Another problem with boost's program options is that multi-value options are parsed in the wrong order when you load several files. This is why I marked #2976 related. Maybe it's time to toss out boost and write our own config parser that does exactly what we need.
aesylwinn
Posts: 243
Joined: 14 Dec 2015, 20:30

Re: Application: AnyOldName3

Post by aesylwinn »

There would appear to be two implementations for reading ini-like files. One using Qt in components/config/settingbase.hpp and one using boost in components/settings/settings.hpp. You may want to look into that. I agree with scrawl. Anyway, good luck. :)
Tels
Posts: 21
Joined: 01 Jul 2016, 18:03
Contact:

Re: Application: AnyOldName3

Post by Tels »

Although some should not re-invent the wheel, writing a config parser isn't that hard, so maybe go for it instead of fighting the existing libraries :)
User avatar
AnyOldName3
Posts: 2676
Joined: 26 Nov 2015, 03:25

Re: Application: AnyOldName3

Post by AnyOldName3 »

I'll see what can be done without totally overhauling everything before I decide to gut a whole system that mostly works. A parser for this kind of thing isn't beyond what I should be able to do - I've written a simple ini file reader for a university project before, and technically have written a general SLR parser generator, too, although that's both totally overkill for this, and also not hugely suited for the kind of data representation that would be useful here.
User avatar
AnyOldName3
Posts: 2676
Joined: 26 Nov 2015, 03:25

Re: Application: AnyOldName3

Post by AnyOldName3 »

I've got one version of a solution to https://bugs.openmw.org/issues/3045 ready as a pull request, but I apparently completely missed the point of what Zini was suggesting. Now I have a better grasp on what's going on with boost::program_options, it shouldn't be too hard to implement something a little more desirable. I could jump ahead with what Zini suggested, but I feel I have a slightly better option, which is described in this github comment:

https://github.com/OpenMW/openmw/pull/9 ... -232140091

I'm asking here instead of just on GitHub so there's a bigger chance that people who are users rather than devs can weigh in an opinion if it's on the forums.

Thanks.
Post Reply