Are multi line properties possible?
Hi, we sometimes have subsystems or complex data structures that are configured via JSON. In these cases it is not possible (dynamic length) or unpractical to split the data into multiple properties. Since it is a hassle to always have to load a file containing the multi line JSON data and the JSON becomes unreadable if smushed into one line, we would like to pass the data via one multi line property.
Looking at the documentation, i did not see an option to do this. Is there really no option for this or did i miss it?
If this is not possible: is there an option to replace the default property file parser and provide a custom one? This would allow us to write a parser that treats a trailing
\ al line continuation.
The configuration file format doesn't allow for setting a property to a multi-line string, you can create a property set by calling
createPropertiesand the use
(I noticed, i used the link to the Ice 3.6 documentation, but we are using Ice 3.7)
So, i took a look at the code and it seems to be impossible to patch this (due to some design decisions by the devs).
Ice::PropertiesIis not exposed to user code and thus impossible to derive. Otherwise it would be enough to derive
Ice::PropertiesI, override the
loadmethod and use a custom version of
createPropertiesto use the class deriving
A fix for this would be to expose the implementation classes (I can understand why this is not done).
Also, it is impossible to use a completely custom implementation of
Ice::Propertiessince parts of ice (
Ice/Instance.cpp:1697) use methods of
Ice::PropertiesIthat are not in the interface of
Ice::Properties. The code relies on an unchecked static cast to cast to
Ice::PropertiesI*to call the function, instead of a dynamic cast and check for
This could be fixed by only using the public interface inside of the implementation.
It would be nice, if the next version of ice would include some way of providing multi line properties (e.g. using a trailing
\) and would allow to patch ice by using your own replacement classes.0