Fix default constructor

pull/41/head
Hieromon Ikasamo 6 years ago
parent e4cc7663bb
commit 5b777ee825
  1. 4
      src/AutoConnectAux.h
  2. 2
      src/AutoConnectElementBasis.h
  3. 46
      src/AutoConnectElementJson.h

@ -48,8 +48,8 @@ typedef enum {
*/ */
class AutoConnectAux : public PageBuilder { class AutoConnectAux : public PageBuilder {
public: public:
explicit AutoConnectAux(const String uri = String(""), const String title = String(""), const bool menu = true, const AutoConnectElementVT addons = AutoConnectElementVT()) : explicit AutoConnectAux(const String& uri = String(""), const String& title = String(""), const AutoConnectElementVT addons = AutoConnectElementVT(), const bool menu = true) :
_title(title), _menu(menu), _addonElm(addons) { setUri(uri.c_str()); _next.release(); _ac.release(); } _title(title), _menu(menu), _uriStr(String(uri)), _addonElm(addons) { _uri = _uriStr.c_str(); _next.release(); _ac.release(); }
~AutoConnectAux(); ~AutoConnectAux();
void add(AutoConnectElement& addon); /**< Add an element to the auxiliary page */ void add(AutoConnectElement& addon); /**< Add an element to the auxiliary page */
void add(AutoConnectElementVT addons); /**< Add the element set to the auxiliary page */ void add(AutoConnectElementVT addons); /**< Add the element set to the auxiliary page */

@ -61,7 +61,7 @@ class AutoConnectElementBasis {
*/ */
class AutoConnectButtonBasis : virtual public AutoConnectElementBasis { class AutoConnectButtonBasis : virtual public AutoConnectElementBasis {
public: public:
explicit AutoConnectButtonBasis(const char* name = "", const char* value = "", const String action = String()) : AutoConnectElementBasis(name, value), action(action) { explicit AutoConnectButtonBasis(const char* name = "", const char* value = "", const String& action = String("")) : AutoConnectElementBasis(name, value), action(String(action)) {
_type = AC_Button; _type = AC_Button;
} }
~AutoConnectButtonBasis() {} ~AutoConnectButtonBasis() {}

@ -47,8 +47,8 @@
class AutoConnectElementJson : virtual public AutoConnectElementBasis { class AutoConnectElementJson : virtual public AutoConnectElementBasis {
public: public:
explicit AutoConnectElementJson(const char* name = "", const char* value = "") { explicit AutoConnectElementJson(const char* name = "", const char* value = "") {
AutoConnectElementBasis::name = name; AutoConnectElementBasis::name = String(name);
AutoConnectElementBasis::value = value; AutoConnectElementBasis::value = String(value);
} }
~AutoConnectElementJson() {} ~AutoConnectElementJson() {}
virtual const size_t getObjectSize(void) const; virtual const size_t getObjectSize(void) const;
@ -70,10 +70,10 @@ class AutoConnectElementJson : virtual public AutoConnectElementBasis {
*/ */
class AutoConnectButtonJson : public AutoConnectElementJson, public AutoConnectButtonBasis { class AutoConnectButtonJson : public AutoConnectElementJson, public AutoConnectButtonBasis {
public: public:
explicit AutoConnectButtonJson(const char* name = "", const char* value = "", const String action = String()) { explicit AutoConnectButtonJson(const char* name = "", const char* value = "", const String& action = String("")) {
AutoConnectButtonBasis::name = name; AutoConnectButtonBasis::name = String(name);
AutoConnectButtonBasis::value = value; AutoConnectButtonBasis::value = String(value);
AutoConnectButtonBasis::action = action; AutoConnectButtonBasis::action = String(action);
} }
~AutoConnectButtonJson() {} ~AutoConnectButtonJson() {}
const size_t getObjectSize(void) const override; const size_t getObjectSize(void) const override;
@ -93,9 +93,9 @@ class AutoConnectButtonJson : public AutoConnectElementJson, public AutoConnectB
class AutoConnectCheckboxJson : public AutoConnectElementJson, public AutoConnectCheckboxBasis { class AutoConnectCheckboxJson : public AutoConnectElementJson, public AutoConnectCheckboxBasis {
public: public:
explicit AutoConnectCheckboxJson(const char* name = "", const char* value = "", const char* label = "", const bool checked = false) { explicit AutoConnectCheckboxJson(const char* name = "", const char* value = "", const char* label = "", const bool checked = false) {
AutoConnectCheckboxBasis::name = name; AutoConnectCheckboxBasis::name = String(name);
AutoConnectCheckboxBasis::value = value; AutoConnectCheckboxBasis::value = String(value);
AutoConnectCheckboxBasis::label = label; AutoConnectCheckboxBasis::label = String(label);
AutoConnectCheckboxBasis::checked = checked; AutoConnectCheckboxBasis::checked = checked;
} }
~AutoConnectCheckboxJson() {} ~AutoConnectCheckboxJson() {}
@ -116,10 +116,10 @@ class AutoConnectCheckboxJson : public AutoConnectElementJson, public AutoConnec
class AutoConnectInputJson : public AutoConnectElementJson, public AutoConnectInputBasis { class AutoConnectInputJson : public AutoConnectElementJson, public AutoConnectInputBasis {
public: public:
explicit AutoConnectInputJson(const char* name = "", const char* value = "", const char* placeholder = "", const char* label = "") { explicit AutoConnectInputJson(const char* name = "", const char* value = "", const char* placeholder = "", const char* label = "") {
AutoConnectInputBasis::name = name; AutoConnectInputBasis::name = String(name);
AutoConnectInputBasis::value = value; AutoConnectInputBasis::value = String(value);
AutoConnectInputBasis::placeholder = placeholder; AutoConnectInputBasis::placeholder = String(placeholder);
AutoConnectInputBasis::label = label; AutoConnectInputBasis::label = String(label);
} }
~AutoConnectInputJson() {} ~AutoConnectInputJson() {}
const size_t getObjectSize(void) const override; const size_t getObjectSize(void) const override;
@ -138,9 +138,9 @@ class AutoConnectInputJson : public AutoConnectElementJson, public AutoConnectIn
class AutoConnectRadioJson : public AutoConnectElementJson, public AutoConnectRadioBasis { class AutoConnectRadioJson : public AutoConnectElementJson, public AutoConnectRadioBasis {
public: public:
explicit AutoConnectRadioJson(const char* name = "", std::vector<String> const& values = {}, const char* label = "", const ACArrange_t order = AC_Vertical, const uint8_t checked = 0) { explicit AutoConnectRadioJson(const char* name = "", std::vector<String> const& values = {}, const char* label = "", const ACArrange_t order = AC_Vertical, const uint8_t checked = 0) {
AutoConnectRadioBasis::name = name; AutoConnectRadioBasis::name = String(name);
AutoConnectRadioBasis::_values = values; AutoConnectRadioBasis::_values = values;
AutoConnectRadioBasis::label = label; AutoConnectRadioBasis::label = String(label);
AutoConnectRadioBasis::order = order; AutoConnectRadioBasis::order = order;
AutoConnectRadioBasis::checked = checked; AutoConnectRadioBasis::checked = checked;
} }
@ -161,9 +161,9 @@ class AutoConnectRadioJson : public AutoConnectElementJson, public AutoConnectRa
class AutoConnectSelectJson : public AutoConnectElementJson, public AutoConnectSelectBasis { class AutoConnectSelectJson : public AutoConnectElementJson, public AutoConnectSelectBasis {
public: public:
explicit AutoConnectSelectJson(const char* name = "", std::vector<String> const& options = {}, const char* label = "") { explicit AutoConnectSelectJson(const char* name = "", std::vector<String> const& options = {}, const char* label = "") {
AutoConnectSelectBasis::name = name; AutoConnectSelectBasis::name = String(name);
AutoConnectSelectBasis::_options = options; AutoConnectSelectBasis::_options = options;
AutoConnectSelectBasis::label = label; AutoConnectSelectBasis::label = String(label);
} }
~AutoConnectSelectJson() {} ~AutoConnectSelectJson() {}
const size_t getObjectSize(void) const override; const size_t getObjectSize(void) const override;
@ -183,9 +183,9 @@ class AutoConnectSelectJson : public AutoConnectElementJson, public AutoConnectS
class AutoConnectSubmitJson : public AutoConnectElementJson, public AutoConnectSubmitBasis { class AutoConnectSubmitJson : public AutoConnectElementJson, public AutoConnectSubmitBasis {
public: public:
explicit AutoConnectSubmitJson(const char* name = "", const char* value = "", const char* uri = "") { explicit AutoConnectSubmitJson(const char* name = "", const char* value = "", const char* uri = "") {
AutoConnectSubmitBasis::name = name; AutoConnectSubmitBasis::name = String(name);
AutoConnectSubmitBasis::value = value; AutoConnectSubmitBasis::value = String(value);
AutoConnectSubmitBasis::uri = uri; AutoConnectSubmitBasis::uri = String(uri);
} }
~AutoConnectSubmitJson() {} ~AutoConnectSubmitJson() {}
const size_t getObjectSize(void) const override; const size_t getObjectSize(void) const override;
@ -205,9 +205,9 @@ class AutoConnectSubmitJson : public AutoConnectElementJson, public AutoConnectS
class AutoConnectTextJson : public AutoConnectElementJson, public AutoConnectTextBasis { class AutoConnectTextJson : public AutoConnectElementJson, public AutoConnectTextBasis {
public: public:
explicit AutoConnectTextJson(const char* name = "", const char* value = "", const char* style = "") { explicit AutoConnectTextJson(const char* name = "", const char* value = "", const char* style = "") {
AutoConnectTextBasis::name = name; AutoConnectTextBasis::name = String(name);
AutoConnectTextBasis::value = value; AutoConnectTextBasis::value = String(value);
AutoConnectTextBasis::style = style; AutoConnectTextBasis::style = String(style);
} }
~AutoConnectTextJson() {} ~AutoConnectTextJson() {}
const size_t getObjectSize(void) const override; const size_t getObjectSize(void) const override;

Loading…
Cancel
Save