Closed jefffisher closed 6 years ago
I think your suggestion is appropriate. The include name guess is a holdover from simpler days when it was expected that every structure would live in its own file with a name that was determined from the structure type name. I've made the requested changed, and it appears in 2.11.e. (I'm on the fence about whether this is a bug fix or a feature change).
It seems to me that a number of other problems will arise if ProtoGen cannot resolve a structure definition. You may want to look into the ability to have one protocol file depend on another. If (for example) you have one structure that you want to share between two protocols you could define that structure in its own XML, and then include it in the other protocol's xml (via xml attribute or command line) that want to reuse the structure.
I have a protocol in which I'm trying to reference a struct defined by a different protocol. It nearly works, except the default behavior of ProtoGen when encountering a struct not defined in the XML file is to guess at an include file, which in this case does not exist:
https://github.com/billvaglienti/ProtoGen/blob/b0a161a459ca585c753f160c560694c1e358c87a/protocolfield.cpp#L1600-L1626
Is there any reason not to remove that behavior and treat them more like enums? For example: