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

Method max

tests/testvalidator.cpp:865–883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

863 // ***** Endpoint for ValidatorMax ******
864 C_ATTR(max, :Local :AutoArgs)
865 void max(Context *c)
866 {
867 QMetaType::Type type = QMetaType::UnknownType;
868
869 if (!c->request()->bodyParameter(u"type"_s).isEmpty()) {
870 const QString t = c->request()->bodyParameter(u"type"_s);
871 if (t == u"sint") {
872 type = QMetaType::Int;
873 } else if (t == u"uint") {
874 type = QMetaType::UInt;
875 } else if (t == u"float") {
876 type = QMetaType::Float;
877 } else if (t == u"string") {
878 type = QMetaType::QString;
879 }
880 }
881 Validator v({new ValidatorMax(u"field"_s, type, 10, m_validatorMessages)});
882 checkResponse(c, v.validate(c));
883 }
884
885 // ***** Endpoint for ValidatorMin ******
886 C_ATTR(min, :Local :AutoArgs)

Callers

nothing calls this directly

Calls 3

requestMethod · 0.80
bodyParameterMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected