aboutsummaryrefslogtreecommitdiff
path: root/ScalarType.h
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2017-01-04 18:02:34 -0800
committerYifan Hong <elsk@google.com>2017-01-12 17:05:17 -0800
commitf5cc2f74e86504f7904a0a24e7fcc00fa19cd579 (patch)
treed1921bdd033ebe8bc7e871dd84e937ed98d989f7 /ScalarType.h
parent5202fb7533be3bf12f9d3595e854ff08549c0c6d (diff)
downloadhidl-f5cc2f74e86504f7904a0a24e7fcc00fa19cd579.tar.gz
Emit toString functions for all types.
* toString() is mainly for debugging purposes only. * For HIDL internal types (hidl_string, hidl_vec, etc.) toString() is found in ::android::hardware::details. * For a user defined type android.hardware.foo@1.0::IFoo.Type, toString() is found in ::android::hardware::foo::V1_0. * For bitfield<::anroid::hardware::foo::V1_0::T> that gets translated to the underlying numeric type of T, it doesn't make sense to override toString(). A templated toString() function for each user-defined HIDL enum \ is introduced into the same namespace; call it with using namespace ::android::hardware::foo::V1_0; toString<IFoo::MyEnumType>(value); Test: hidl_test and look at the output of logcat Bug: 33459772 Change-Id: I70eee018e31d700bf1376334276dbd343af5615f
Diffstat (limited to 'ScalarType.h')
-rw-r--r--ScalarType.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/ScalarType.h b/ScalarType.h
index 80f81596..8b70d725 100644
--- a/ScalarType.h
+++ b/ScalarType.h
@@ -80,6 +80,11 @@ struct ScalarType : public Type {
ErrorMode mode,
bool needsCast) const;
+ void emitHexDump(
+ Formatter &out,
+ const std::string &streamName,
+ const std::string &name) const;
+
void emitJavaFieldReaderWriter(
Formatter &out,
size_t depth,