serialization: use the same inflection as sdbus++
When generating code sdbus++ uses python inflection to normalize names.
Use the sdbus++ module that does this when we generate the code that
calls methods in code generated by sdbus++. This avoids build failures
like:
gen_serialization.hpp:22:68: error: ‘const class
sdbusplus::xyz::openbmc_project::Example::server::Iface2’ has no member
named ‘example_Property4’; did you mean ‘exampleProperty4’?
Change-Id: I4b6dbb1f977465ea176f27d021ed2633ae40c37b
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/gen_serialization.mako.hpp b/gen_serialization.mako.hpp
index 5cf3c13..4245fd9 100644
--- a/gen_serialization.mako.hpp
+++ b/gen_serialization.mako.hpp
@@ -25,7 +25,7 @@
const std::uint32_t version)
{
<%
- props = ["object." + p[:1].lower() + p[1:] + "()" for p in properties]
+ props = ["object." + p.camelCase + "()" for p in properties]
props = ', '.join(props)
%>\
a(${props});
@@ -38,15 +38,15 @@
const std::uint32_t version)
{
% for p in properties:
-<% t = "object." + p[:1].lower() + p[1:] + "()" %>\
- decltype(${t}) ${p}{};
+<% t = "object." + p.camelCase + "()" %>\
+ decltype(${t}) ${p.CamelCase}{};
% endfor
<%
- props = ', '.join(properties)
+ props = ', '.join([p.CamelCase for p in properties])
%>\
a(${props});
% for p in properties:
-<% t = "object." + p[:1].lower() + p[1:] + "(" + p + ")" %>\
+<% t = "object." + p.camelCase + "(" + p.CamelCase + ")" %>\
${t};
% endfor
}