You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, another question: is it possible to conditially group a set of members in a binding trait, and if so, what's the syntax?
a bit stupid example because you could create another struct/class Turnus with its own binding instead:
structtest {
int m_id;
std::string m_turnusEinheit{}; //'E'=einmalig, 'D'=täglich, 'W'=wöchentlich, 'M'=monatlichunsignedint m_turnusAnzahl{}; // abhängig von der Turnuseinheit auszuwerten, z.B. 2 = alle 2 Wochen/Monateunsignedint m_turnusTag{}; //'W': 1-7 = Montag-Sonntag; 'M': 1-31 = der 1. des Monats, der 2. des Monats,..., der 31. des Monats
};
template<typename T, typename = void>
structmy_traits
: public tao::json::traits<T>
{};
template<>
structmy_traits<test>
: public tao::json::binding::object<
TAO_JSON_BIND_REQUIRED("id", &test::m_id),
// TODO: all three only if (!m_turnusEinheit.empty())
TAO_JSON_BIND_OPTIONAL("turnusEinheit", &test::m_turnusEinheit),
TAO_JSON_BIND_OPTIONAL("turnusAnzahl", &test::m_turnusAnzahl),
TAO_JSON_BIND_OPTIONAL("turnusTag", &test::m_turnusTag)
>
{};
The text was updated successfully, but these errors were encountered:
Hi, another question: is it possible to conditially group a set of members in a binding trait, and if so, what's the syntax?
a bit stupid example because you could create another struct/class Turnus with its own binding instead:
The text was updated successfully, but these errors were encountered: