diff options
author | Zhuoyao Zhang <zhuoyao@google.com> | 2016-10-06 15:05:39 -0700 |
---|---|---|
committer | Zhuoyao Zhang <zhuoyao@google.com> | 2016-10-06 17:39:01 -0700 |
commit | c5ea9f589cc7cce0b5e97bd4ac6a8561eb313a02 (patch) | |
tree | 1cfa5088716ed2fc1d183f7083bbdeed26ec63b1 /VectorType.cpp | |
parent | 8efccec25e4010829fff42d5d953dfb83549d807 (diff) | |
download | hidl-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.cpp | 7 |
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) { |