C++: add utility method to dump usages.

Change-Id: Icff6e9310a45e66b573fb2a6623a10e025c43539
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>