mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-13 14:51:21 +10:00
trivial: WiFiManagerParameter get accessors should work on const instances
Enhancement: It should be okay to invoke getID() and getValue() in a const instance of the WiFiManagerParameter class. See: https://github.com/flavio-fernandes/persistWifiSetting/commit/135adb1c7e436db1ed92ccd5eb522b9ae418b216
This commit is contained in:
+7
-7
@@ -88,25 +88,25 @@ void WiFiManagerParameter::setValue(const char *defaultValue, int length) {
|
||||
strncpy(_value, defaultValue, _length);
|
||||
}
|
||||
}
|
||||
const char* WiFiManagerParameter::getValue() {
|
||||
const char* WiFiManagerParameter::getValue() const {
|
||||
return _value;
|
||||
}
|
||||
const char* WiFiManagerParameter::getID() {
|
||||
const char* WiFiManagerParameter::getID() const {
|
||||
return _id;
|
||||
}
|
||||
const char* WiFiManagerParameter::getPlaceholder() {
|
||||
const char* WiFiManagerParameter::getPlaceholder() const {
|
||||
return _label;
|
||||
}
|
||||
const char* WiFiManagerParameter::getLabel() {
|
||||
const char* WiFiManagerParameter::getLabel() const {
|
||||
return _label;
|
||||
}
|
||||
int WiFiManagerParameter::getValueLength() {
|
||||
int WiFiManagerParameter::getValueLength() const {
|
||||
return _length;
|
||||
}
|
||||
int WiFiManagerParameter::getLabelPlacement() {
|
||||
int WiFiManagerParameter::getLabelPlacement() const {
|
||||
return _labelPlacement;
|
||||
}
|
||||
const char* WiFiManagerParameter::getCustomHTML() {
|
||||
const char* WiFiManagerParameter::getCustomHTML() const {
|
||||
return _customHTML;
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -115,13 +115,13 @@ class WiFiManagerParameter {
|
||||
WiFiManagerParameter(const char *id, const char *label, const char *defaultValue, int length, const char *custom, int labelPlacement);
|
||||
~WiFiManagerParameter();
|
||||
|
||||
const char *getID();
|
||||
const char *getValue();
|
||||
const char *getLabel();
|
||||
const char *getPlaceholder(); // @deprecated, use getLabel
|
||||
int getValueLength();
|
||||
int getLabelPlacement();
|
||||
const char *getCustomHTML();
|
||||
const char *getID() const;
|
||||
const char *getValue() const;
|
||||
const char *getLabel() const;
|
||||
const char *getPlaceholder() const; // @deprecated, use getLabel
|
||||
int getValueLength() const;
|
||||
int getLabelPlacement() const;
|
||||
const char *getCustomHTML() const;
|
||||
void setValue(const char *defaultValue, int length);
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user