MCPcopy Create free account
hub / github.com/Segs/Segs / logInvoke

Function logInvoke

3rd_party/jcon-cpp/src/jcon/json_rpc_server.cpp:439–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437namespace {
438
439QString logInvoke(const QMetaMethod& meta_method,
440 const QVariantList& args,
441 const QVariant& return_value)
442{
443 const auto ns = meta_method.parameterNames();
444 auto ps = jcon::variantListToStringList(args);
445 QStringList args_sl;
446 std::transform(ns.begin(), ns.end(), ps.begin(),
447 std::back_inserter(args_sl),
448 [](auto x, auto y) -> QString {
449 return static_cast<QString>(x) + ": " + y;
450 }
451 );
452
453 auto msg = QString("%1 invoked ")
454 .arg(static_cast<QString>(meta_method.name()));
455
456 if (args_sl.empty()) {
457 msg += "without arguments";
458 } else {
459 msg += QString("with argument%1: %2")
460 .arg(args_sl.size() == 1 ? "" : "s")
461 .arg(args_sl.join(", "));
462 }
463
464 if (return_value.isValid()) {
465 msg += " -> returning: " + jcon::variantToString(return_value);
466 }
467
468 return msg;
469}
470
471}

Callers 1

doCallMethod · 0.85

Calls 8

variantListToStringListFunction · 0.85
variantToStringFunction · 0.85
QStringClass · 0.70
beginMethod · 0.45
endMethod · 0.45
nameMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected