-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparam.h
52 lines (44 loc) · 1.27 KB
/
param.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <ESP8266WiFi.h>
class CParam {
public:
CParam(const char* aName) : mName(aName) {}
virtual void write(size_t& aPos) = 0;
virtual void read(size_t& aPos) = 0;
virtual String toHtmlForm() = 0;
virtual String getValue() = 0;
virtual byte getByteValue() = 0;
virtual void setValue(String& aValue) = 0;
const char* getName() { return mName; }
protected:
const char* mName;
};
class CParamByte : public CParam {
public:
CParamByte(const char* aName) : CParam(aName) {}
virtual void write(size_t& aPos);
virtual void read(size_t& aPos);
virtual String toHtmlForm();
virtual String getValue();
virtual byte getByteValue();
virtual void setValue(String& aValue);
protected:
byte mValue = 0;
};
class CParamBool : public CParamByte {
public:
CParamBool(const char* aName) : CParamByte(aName) {}
virtual String toHtmlForm();
virtual String getValue();
};
class CParamString : public CParam {
public:
CParamString(const char* aName) : CParam(aName) {}
virtual void write(size_t& aPos);
virtual void read(size_t& aPos);
virtual String toHtmlForm();
virtual String getValue();
virtual byte getByteValue();
virtual void setValue(String& aValue);
protected:
String mValue;
};