Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
introspectiontools.cpp File Reference

The object_tree / object_inspect / object_set / object_invoke tools. More...

#include "server_p.h"
#include <sonde/introspectiontools.h>
#include <sonde/objecttree.h>
#include <sonde/schema.h>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonDocument>
#include <QtCore/QMetaMethod>
#include <QtCore/QMetaProperty>
#include <QtCore/QProperty>
#include <QtCore/QSet>
#include <algorithm>
#include <array>
#include <cstddef>

Classes

class  Sonde::anonymous_namespace{introspectiontools.cpp}::TreePrinter
 Prints an object tree as indented describe() lines, with the object_tree tool's limits and filters. More...
struct  Sonde::anonymous_namespace{introspectiontools.cpp}::TreePrinter::HiddenNote
 One hidden subtree in the note. More...

Namespaces

namespace  Sonde
 Embeddable Model Context Protocol server for Qt applications.

Functions

bool Sonde::anonymous_namespace{introspectiontools.cpp}::isHidden (const QObject *o)
 Whether o has a false "visible" property.
QObject * Sonde::anonymous_namespace{introspectiontools.cpp}::argumentObject (const QJsonObject &args, QString *error)
 Resolves the "object" argument, or explains why it can't.
ToolResult Sonde::anonymous_namespace{introspectiontools.cpp}::objectTree (const QJsonObject &args)
 The object_tree tool.
void Sonde::anonymous_namespace{introspectiontools.cpp}::installObjectTree (Server &server)
 Registers object_tree.
bool Sonde::anonymous_namespace{introspectiontools.cpp}::hasBinding (const QMetaProperty &p, QObject *o)
 Whether property p of o is BINDABLE and has a binding now.
QStringList Sonde::anonymous_namespace{introspectiontools.cpp}::propertyLines (QObject *o)
 " name: Type = value" lines for the static and dynamic properties of o.
QStringList Sonde::anonymous_namespace{introspectiontools.cpp}::methodLines (const QMetaObject *mo)
 The "signals:", "slots:" and "invokables:" sections for mo (QObject's own methods omitted).
ToolResult Sonde::anonymous_namespace{introspectiontools.cpp}::objectInspect (const QJsonObject &args)
 The object_inspect tool.
void Sonde::anonymous_namespace{introspectiontools.cpp}::installObjectInspect (Server &server)
 Registers object_inspect.
ToolResult Sonde::anonymous_namespace{introspectiontools.cpp}::objectSetProperty (const QJsonObject &args)
 The object_set tool.
void Sonde::anonymous_namespace{introspectiontools.cpp}::installObjectSetProperty (Server &server)
 Registers object_set.
std::optional< ToolResult > Sonde::anonymous_namespace{introspectiontools.cpp}::tryInvoke (QObject *o, const QMetaMethod &m, const QJsonArray &callArgs, QString *conversionError)
 Converts callArgs to m's parameter types and invokes it on o.
ToolResult Sonde::anonymous_namespace{introspectiontools.cpp}::objectInvoke (const QJsonObject &args)
 The object_invoke tool: tries each overload with a matching argument count.
void Sonde::anonymous_namespace{introspectiontools.cpp}::installObjectInvoke (Server &server)
 Registers object_invoke.
void Sonde::installIntrospectionTools (Server &server)
 Registers the QObject introspection tools on server.

Variables

constexpr qsizetype Sonde::anonymous_namespace{introspectiontools.cpp}::kMaxInvokeArguments = 10
 Most arguments object_invoke passes (QMetaMethod::invoke's limit).

Detailed Description

The object_tree / object_inspect / object_set / object_invoke tools.