MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / enumProp

Function enumProp

app/src/API/SchemaBuilder.h:62–74  ·  view source on GitHub ↗

* @brief Build a SchemaProp constrained to a fixed enum, with optional default. */

Source from the content-addressed store, hash-verified

60 * @brief Build a SchemaProp constrained to a fixed enum, with optional default.
61 */
62[[nodiscard]] inline SchemaProp enumProp(QString name,
63 QString description,
64 QJsonArray values,
65 QJsonValue default_value = {})
66{
67 SchemaProp p;
68 p.name = std::move(name);
69 p.type = QStringLiteral("integer");
70 p.description = std::move(description);
71 p.enumValues = std::move(values);
72 p.defaultValue = std::move(default_value);
73 return p;
74}
75
76/**
77 * @brief Build a SchemaProp for an array with a full items sub-schema.

Callers 2

registerCommandsMethod · 0.85
registerLineSettingsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected