cpp: replace usage of removed MetadataTools methods

This fixes compile errors introduced by 6b31a4ff9ac4bfc1ccf356804add10dc637366f5