On 14.04.25 04:31, ichthyo wrote:
My plan looks as follows:
- create a copy of the existing XMLwrapper
- re-order existing functionality into three layers
+ the front-end used by Yoshimi core logic (I'll call this "XMLStore")
+ a new internal abstraction of an XML subtree (I'll call this "XMLtree")
+ a back-end or policy class which exposes some relevant base operations
of lib MXML, to the degree necessary to implement "XMLtree"
- next step is to simplify the XMLStore (front-End) and remove the
unnecessary statefulness (esp. the context stack adds a lot of complexity
and it seems it can be replaced by direct navigation functions of MXML)
- switch existing usages of XML access to the reworked code
- the direct dependencies to MXML can then be removed from Yoshimi core code
At this point, we should test and integrate; if all was done correct,
no externally visible behaviour of yoshimi is changed.
Hi Yoshimi-devs,
as expected, going through all the numerous usages of XMLwrapper war a tedious
task -- but in the end all went well; now I'd like to present the reworked
state on my "mxml"-branch (see https://github.com/Ichthyostega/yoshimi.git)
Most important for me now is the question: does the new interface
and usage patterns look plausible for a developer working on Yoshimi?
Can you roughly follow the logic of the implementation in Misc/XMLStore.h|cpp ?
I have added some documentation into dev_notes/XML-Storage.txt and also
moved my developer-test into this directory (which could serve as a
self-contained example how to use this code).
The most notable change is that I have split the functionality of the
former class "XMLwrapper" into two distinct front-end classes:
- XMLStore is the access point and allows to create, load and save
tree structured data. And it manages the metadata
- XMLtree is a ligthweight smart-pointer, which refers to some
sub-tree in the XML. It can /not/ be "navigated" (as was the
usage, with the old XMLwrapper); rather, you /retrieve/ nested
sub-elements on an existing XMLtree (functions addElm / getElm)
All the data manipulation functions were relocated to XMLtree.
Please note that lib-MXML is now solely imported into XMLStore.cpp
and usage of its data types and functions is confined to this
compilation unit.
This was the whole point of the exercise and will allow us (in a second step)
to add a switch and an adapted implementation for lib-MXML v4.0
-- Hermann
_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel