MCPcopy Create free account
hub / github.com/cutelyst/cutelyst / min

Method min

tests/testvalidator.cpp:887–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885 // ***** Endpoint for ValidatorMin ******
886 C_ATTR(min, :Local :AutoArgs)
887 void min(Context *c)
888 {
889 c->setStash(u"compval"_s, 10);
890 QMetaType::Type type = QMetaType::UnknownType;
891
892 if (!c->request()->bodyParameter(u"type"_s).isEmpty()) {
893 const QString t = c->request()->bodyParameter(u"type"_s);
894 if (t == u"sint") {
895 type = QMetaType::Int;
896 } else if (t == u"uint") {
897 type = QMetaType::UInt;
898 } else if (t == u"float") {
899 type = QMetaType::Float;
900 } else if (t == u"string") {
901 type = QMetaType::QString;
902 }
903 }
904 Validator v({new ValidatorMin(u"field"_s, type, u"compval"_s, m_validatorMessages)});
905 checkResponse(c, v.validate(c));
906 }
907
908 // ***** Endpoint for ValidatorNotIn ******
909 C_ATTR(notIn, :Local :AutoArgs)

Callers

nothing calls this directly

Calls 4

setStashMethod · 0.80
requestMethod · 0.80
bodyParameterMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected