31 lines
490 B
C
31 lines
490 B
C
#ifndef INITIAL_H
|
|
#define INITIAL_H
|
|
|
|
enum Initial {
|
|
INITIAL_OFF,
|
|
INITIAL_ON,
|
|
INITIAL_CYCLE,
|
|
};
|
|
|
|
inline Initial stringToInitial(const String &str) {
|
|
if (str == "ON") {
|
|
return INITIAL_ON;
|
|
}
|
|
if (str == "CYCLE") {
|
|
return INITIAL_CYCLE;
|
|
}
|
|
return INITIAL_OFF;
|
|
}
|
|
|
|
inline const char *initialToString(const Initial value) {
|
|
switch (value) {
|
|
case INITIAL_ON:
|
|
return "ON";
|
|
case INITIAL_CYCLE:
|
|
return "CYCLE";
|
|
default:
|
|
return "OFF";
|
|
}
|
|
}
|
|
|
|
#endif |