Add a convenience function pb_get_encoded_size()
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>
Sat, 5 Apr 2014 08:26:39 +0000 (11:26 +0300)
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>
Sat, 5 Apr 2014 08:26:39 +0000 (11:26 +0300)
commitb63e582bdb34b4727a8eb551fc72ee0476047a46
tree37e19df37e51132052c54ce9b46d1cc9b16b0698
parente5b855fec5d2977971f96d817728c7a3ee8077b2
Add a convenience function pb_get_encoded_size()

There is minimal size penalty from this, and it is probably much more
intuitive to use than PB_OSTREAM_SIZING itself.

This has been suggested before also, but I ended up refusing it back
them. Reconsidering it now, I see that an intuitive API is much better
than any amount of documentation explaining a non-intuitive API.

Update issue 16
Status: FixedInGit
pb_encode.c
pb_encode.h
tests/encode_unittests/encode_unittests.c