[omniORB] orbOptions class - Usage from user code?

Martin Ba 0xcdcdcdcd at gmx.at
Thu Sep 12 09:28:22 BST 2019


On 11.09.2019 11:08, Duncan Grisby wrote:
> On Fri, 2019-08-02 at 14:19 +0200, Martin Ba via omniORB-list wrote:
>
>> Is it meaningfully possible to use the `orbOptions` class from
>> `omniORB4\internal\orbOptions.h` from regular user code?
>
> Sorry for taking ages to reply to this. Maybe it's too late now, but
> anyway...
>
> It's generally best not to reach into the things in "internal", but
> they are installed so application-level code can see them if it needs
> to. There is no fundamental reason why you shouldn't use them.
>
>
>> We have now the use case that we would need to add another option to
>> the config file from our code, (...)
>
> So you intend to use the code to parse the file, then use the parsed
> results to rewrite a new file with the same content plus some extra
> things?  Aside from the problem of it being an "internal" class, the
> other problem you would have is that it doesn't maintain comments or
> whitespace structure from the config file, so if the user has added
> comments to explain their edits, you will lose them.
>
> (...)
>
>
> If I understand what you are trying to do (and maybe I don't!), I think
> you would probably be better off just writing some simple code to
> rewrite the file, rather than trying to reuse orbOptions.
>

Duncan, thanks for that info!

Yes, I ended up just using a simple regex based utility class to insert
the relevant infos.

I abandoned the approach with the omniOptions exactly because of the
comment and whitespace issues :-)

best,
Martin




More information about the omniORB-list mailing list