billvaglienti / ProtoGen

Communications protocol generation software
MIT License
30 stars 16 forks source link

Feature Request: Support top-level markdown in external XML files #92

Closed SchrodingersGat closed 4 years ago

SchrodingersGat commented 4 years ago

It would be handy to allow included source files (i.e. xml files called using the tag to have some top-level control of the packets / structures defined therein.

I am imagining a scenario where a designer wishes to separate the generated code from each xml file into a separate c/h file pair. Currently this must be specified by setting the file= parameter of each and every packet.

If the main protocol file is as follows:

<Protocol name="animals">

<Require file="cats.xml">
<Require file="dogs.xml">

</Protocol>

Then we could write the sub-files as:

<Protocol name="dogs" file="DogPackets">
...
</Protocol>
<Protocol name="cats" file="CatPackets">
...
</Protocol>

Then (by default) all the dog packets are in DogPackets.h - although this can still be overridden on a per-packet basis...

billvaglienti commented 4 years ago

Try the latest (2.19), I think this does what you want.

SchrodingersGat commented 4 years ago

Awesome, it looks like this is doing exactly what I'd expect. Thanks!