aboutsummaryrefslogtreecommitdiff
path: root/VectorType.cpp
diff options
context:
space:
mode:
authorZhuoyao Zhang <zhuoyao@google.com>2016-10-06 15:05:39 -0700
committerZhuoyao Zhang <zhuoyao@google.com>2016-10-06 17:39:01 -0700
commitc5ea9f589cc7cce0b5e97bd4ac6a8561eb313a02 (patch)
tree1cfa5088716ed2fc1d183f7083bbdeed26ec63b1 /VectorType.cpp
parent8efccec25e4010829fff42d5d953dfb83549d807 (diff)
downloadhidl-c5ea9f589cc7cce0b5e97bd4ac6a8561eb313a02.tar.gz
Update hidl-gen support for vts.
* Support the new Enum type (based on scalar_data) * Support sub_struct/sub_union defined within compound type. * Code cleanup: use getVtsType() instead of hard code ones. Test: make hidl-gen, locally run make hidl_gen_test. Bug: 30762234 Change-Id: I9a21b5757e0a9fc6cd1bf829ab123565a7990ad5
Diffstat (limited to 'VectorType.cpp')
-rw-r--r--VectorType.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/VectorType.cpp b/VectorType.cpp
index 2e7d9322..f656281d 100644
--- a/VectorType.cpp
+++ b/VectorType.cpp
@@ -65,6 +65,10 @@ std::string VectorType::getJavaType(
return mElementType->getJavaType(&elementExtra) + elementExtra;
}
+std::string VectorType::getVtsType() const {
+ return "TYPE_VECTOR";
+}
+
void VectorType::emitReaderWriter(
Formatter &out,
const std::string &name,
@@ -540,7 +544,8 @@ bool VectorType::resultNeedsDeref() const {
}
status_t VectorType::emitVtsTypeDeclarations(Formatter &out) const {
- out << "type: TYPE_VECTOR\n" << "vector_value: {\n";
+ out << "type: " << getVtsType() << "\n";
+ out << "vector_value: {\n";
out.indent();
status_t err = mElementType->emitVtsTypeDeclarations(out);
if (err != OK) {