jeudi 4 mai 2017

c++ comprehensive error reporting of parsed protobuf

just a quick question if anyone knows how to do this

I have a text config file that I am parsing in C++ to generate a protobuf configuration object.

The proto itself is composed of objects from several other protos. Does anyone know if there is a pre-existing way to generate a prototype for the full proto object?

Related, I wanted to print out a detailed summary of all the fields that were either unknown (shouldn't be there) or missing (possibly even the non-required fields), so that it is easy for a user to see a summary of what is wrong

Currently, parsing aborts on the first of any unknown field or missing (required) field, and it seems unusually tedious to have to go and change one value at a time, re-run, find another error, change etc.

It seems like there should be a better solution for all this, but I can't find it either in standard proto or online. Any thoughts welcome!





Aucun commentaire:

Enregistrer un commentaire