Supports ArduinoJson V6. Issue #47

pull/57/head
Hieromon Ikasamo 6 years ago
parent e790a0f4ac
commit 920be8bb7e
  1. 2
      src/AutoConnectAuxImpl.h
  2. 60
      src/AutoConnectElementBasisImpl.h

@ -256,7 +256,7 @@ bool AutoConnectAux::_parseElement(T in, const String& name) {
AC_DBG("Deserialize:%s\n", err.c_str()); AC_DBG("Deserialize:%s\n", err.c_str());
return false; return false;
} }
jb = jsonBuffer.as<JsonObject>(); jb = jsonBuffer.as<JsonVariant>();
#endif #endif
return _loadElement(jb, name); return _loadElement(jb, name);
} }

@ -19,66 +19,6 @@
#endif #endif
#include "AutoConnectElementBasis.h" #include "AutoConnectElementBasis.h"
/**
* Casts only a class derived from the AutoConnectElement class to the
* actual element class.
*/
// template<>
// inline AutoConnectButtonBasis& AutoConnectElementBasis::as(void) {
// if (typeOf() != AC_Button)
// AC_DBG("%s mismatched type as <%d>\n", name.c_str(), (int)typeOf());
// return reinterpret_cast<AutoConnectButtonBasis&>(*this);
// }
// template<>
// inline AutoConnectCheckboxBasis& AutoConnectElementBasis::as(void) {
// if (typeOf() != AC_Checkbox)
// AC_DBG("%s mismatched type as <%d>\n", name.c_str(), (int)typeOf());
// return reinterpret_cast<AutoConnectCheckboxBasis&>(*this);
// }
// template<>
// inline AutoConnectFileBasis& AutoConnectElementBasis::as(void) {
// if (typeOf() != AC_File)
// AC_DBG("%s mismatched type as <%d>\n", name.c_str(), (int)typeOf());
// return reinterpret_cast<AutoConnectFileBasis&>(*this);
// }
// template<>
// inline AutoConnectInputBasis& AutoConnectElementBasis::as(void) {
// if (typeOf() != AC_Input)
// AC_DBG("%s mismatched type as <%d>\n", name.c_str(), (int)typeOf());
// return reinterpret_cast<AutoConnectInputBasis&>(*this);
// }
// template<>
// inline AutoConnectRadioBasis& AutoConnectElementBasis::as(void) {
// if (typeOf() != AC_Radio)
// AC_DBG("%s mismatched type as <%d>\n", name.c_str(), (int)typeOf());
// return reinterpret_cast<AutoConnectRadioBasis&>(*this);
// }
// template<>
// inline AutoConnectSelectBasis& AutoConnectElementBasis::as(void) {
// if (typeOf() != AC_Select)
// AC_DBG("%s mismatched type as <%d>\n", name.c_str(), (int)typeOf());
// return reinterpret_cast<AutoConnectSelectBasis&>(*this);
// }
// template<>
// inline AutoConnectSubmitBasis& AutoConnectElementBasis::as(void) {
// if (typeOf() != AC_Submit)
// AC_DBG("%s mismatched type as <%d>\n", name.c_str(), (int)typeOf());
// return reinterpret_cast<AutoConnectSubmitBasis&>(*this);
// }
// template<>
// inline AutoConnectTextBasis& AutoConnectElementBasis::as(void) {
// if (typeOf() != AC_Text)
// AC_DBG("%s mismatched type as <%d>\n", name.c_str(), (int)typeOf());
// return reinterpret_cast<AutoConnectTextBasis&>(*this);
// }
/** /**
* Generate an HTML <button> element. The onclick behavior depends on * Generate an HTML <button> element. The onclick behavior depends on
* the code held in factionf member. * the code held in factionf member.

Loading…
Cancel
Save