Generate code for AIDL defined string constants
Also validate that constant names are not duplicated between
integer and string constants.
Bug: 28233277
Test: Unittests expanded to reflect this change.
Integration tests expanded to reflect this change.
Change-Id: If46619151cf6ff0146a2dfa90b863b096435a30a
diff --git a/ast_cpp.cpp b/ast_cpp.cpp
index 093ff14..783b0f3 100644
--- a/ast_cpp.cpp
+++ b/ast_cpp.cpp
@@ -182,12 +182,16 @@
is_const_(modifiers & IS_CONST),
is_virtual_(modifiers & IS_VIRTUAL),
is_override_(modifiers & IS_OVERRIDE),
- is_pure_virtual_(modifiers & IS_PURE_VIRTUAL) {}
+ is_pure_virtual_(modifiers & IS_PURE_VIRTUAL),
+ is_static_(modifiers & IS_STATIC) {}
void MethodDecl::Write(CodeWriter* to) const {
if (is_virtual_)
to->Write("virtual ");
+ if (is_static_)
+ to->Write("static ");
+
to->Write("%s %s", return_type_.c_str(), name_.c_str());
arguments_.Write(to);