forked from Kistler-Group/sdbus-cpp
stub-generator: fixed issue when <arg> in <method> does not have "name" property
This commit is contained in:
committed by
Stanislav Angelovič
parent
ec06462713
commit
108c33faac
@@ -108,12 +108,21 @@ std::tuple<std::string, std::string, std::string> BaseGenerator::argsToNamesAndT
|
|||||||
{
|
{
|
||||||
std::ostringstream argSS, argTypeSS, typeSS;
|
std::ostringstream argSS, argTypeSS, typeSS;
|
||||||
|
|
||||||
bool firstArg{true};
|
for (auto i = 0; i < args.size(); ++i)
|
||||||
for (const auto& arg : args)
|
|
||||||
{
|
{
|
||||||
if (firstArg) firstArg = false; else { argSS << ", "; argTypeSS << ", "; typeSS << ", "; }
|
auto arg = args.at(i);
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
argSS << ", ";
|
||||||
|
argTypeSS << ", ";
|
||||||
|
typeSS << ", ";
|
||||||
|
}
|
||||||
|
|
||||||
auto argName = arg->get("name");
|
auto argName = arg->get("name");
|
||||||
|
if (argName.empty())
|
||||||
|
{
|
||||||
|
argName = "arg" + std::to_string(i);
|
||||||
|
}
|
||||||
auto type = signature_to_type(arg->get("type"));
|
auto type = signature_to_type(arg->get("type"));
|
||||||
argSS << argName;
|
argSS << argName;
|
||||||
argTypeSS << "const " << type << "& " << argName;
|
argTypeSS << "const " << type << "& " << argName;
|
||||||
|
Reference in New Issue
Block a user