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

Function requireString

app/src/API/Handlers/DataTablesHandler.cpp:41–48  ·  view source on GitHub ↗

* @brief Extracts a required non-empty string param or returns an error response. */

Source from the content-addressed store, hash-verified

39 * @brief Extracts a required non-empty string param or returns an error response.
40 */
41[[nodiscard]] static bool requireString(const QJsonObject& params, const QString& key, QString& out)
42{
43 if (!params.contains(key))
44 return false;
45
46 out = params.value(key).toString();
47 return !out.isEmpty();
48}
49
50/**
51 * @brief Converts a QJsonValue to a QVariant preserving numeric vs string type.

Callers 9

tableGetMethod · 0.85
tableDeleteMethod · 0.85
tableRenameMethod · 0.85
registerAddMethod · 0.85
registerDeleteMethod · 0.85
registerUpdateMethod · 0.85
valueGetMethod · 0.85
valueSetMethod · 0.85
valueHandleMethod · 0.85

Calls 3

isEmptyMethod · 0.80
containsMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected