Replies: 2 comments 1 reply
|
The funny thing is, I had an abstraction over Pugi called Anyway, yes this would not be difficult to do. It could, possibly offer an option to omit the vendored pugixml implementation for those who will be injecting their own XML Dom parser. |
|
It was not a C++20 concept, though that seems like it might be the right fit now that we are on C++20. It's possible I did not need the template at all in retrospect, but then I would have had to supply the parser as an argument to the factory function. Here is my interface: https://github.com/rpatters1/musxdom/blob/main/src/musx/xml/XmlInterface.h The way I am imagining it, the vendored pugi would become a dependency of the tests. The MX library itself would have no xml dependency at all, and clients could use whichever xml package they preferred. Musxdom provides this implementation for pugi: https://github.com/rpatters1/musxdom/blob/main/src/musx/xml/PugiXmlImpl.h. MX would need the equivalent of this for its tests, and ideally it would be available for a client to use by supplying their own pugi. (There are some macros in musxdom that do some of this automatically, but I am increasingly convinced they were a bad idea.) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Given the stated desire in the README to eliminate dependencies, something we might consider is replacing pugi with an interface class that defines all the requirements for an xml parser in MX. Then the client could create an implementation with whatever parser they wish.
For example
might become
I used this approach in
musxdom, and it has been great. I was able to use MuseScore's own xml parser rather than introduce pugi when I and another guy created the direct finale importer for MuseScore. (Sadly, so far, not merged.) Personally, I think MX would be a great choice if they ever decide to rewrite their musicxml import-export. (Sorely needed, imho.) Having this would be one less friction point. (It is true that I converted them from tinyxml2 over to pugi about a year ago, but the point is we could go through their xml frontend rather than assume a backend.)musxdomprovides (in addition to the xml parser interface class) optional implementations for pugi, tinyxml2, rapidxml, and QtXml. If MX were to go this route, you'd need at least one of them to run the tests. (Probably pugi.)I would also recommend this approach for zip functions (if we ever do mxl) and json (if it were ever required).
All reactions