c2hal: Emit camelCase and PascalCase things.
Test: built, verified test headers output. Made sure it still worked on
opengl/telephony/libhardware headers.
Change-Id: Iabeb0e912dc7df6b2eae76b962531a30c83593bf
diff --git a/c2hal/Declaration.cpp b/c2hal/Declaration.cpp
index 8f88ea6..894965c 100644
--- a/c2hal/Declaration.cpp
+++ b/c2hal/Declaration.cpp
@@ -16,6 +16,7 @@
#include "Declaration.h"
+#include <hidl-util/StringHelper.h>
#include <regex>
namespace android {
@@ -35,6 +36,16 @@
mName = name;
}
+void Declaration::forceCamelCase() {
+ mName = StringHelper::RTrim(mName, "_t");
+ mName = StringHelper::SnakeCaseToCamelCase(mName);
+}
+
+void Declaration::forcePascalCase() {
+ mName = StringHelper::RTrim(mName, "_t");
+ mName = StringHelper::SnakeCaseToPascalCase(mName);
+}
+
const std::string& Declaration::getComment() const {
return mComment;
}