libchromeos: Add functions to undecorate type names

Added UndecorateTypeName() and GetUndecoratedTypeName() functions
to get undecorated (demangled) C++ name normally returned by
g++'s implementation of type_info::name() method.

A lot of template-base code such as chromeos::Any and D-Bus
data serialization framework uses the native (mangled) C++ type
names when reporting type errors and right now the error messages
are rather cryptic. For example, writing an std::vector<char> to
D-Bus is not supported, since D-Bus doesn't have signed Int8 type.
Currently the error message would be output as:

Type 'St6vectorIcSaIcEE' is not supported by D-Bus

By undecorating the type name we now get this error message instead:

Type 'std::vector<char, std::allocator<char>>' is not supported by D-Bus

BUG=None
TEST=FEATURES=test emerge-link libchromeos

Change-Id: Ied3c5e4db7814bcdd28640f5975093659453bcf3
Reviewed-on: https://chromium-review.googlesource.com/221420
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
7 files changed