Planeshift
|
Base class for on, off, toggle string Parser. More...
#include <adminmanager.h>
Public Types | |
enum | ADMINCMD_SETTING_ONOFF { ADMINCMD_SETTING_UNKNOWN = 0, ADMINCMD_SETTING_ON = 1, ADMINCMD_SETTING_OFF, ADMINCMD_SETTING_TOGGLE } |
detected settings recognized by the parser. More... | |
Public Member Functions | |
AdminCmdOnOffToggleParser (ADMINCMD_SETTING_ONOFF defaultValue=ADMINCMD_SETTING_UNKNOWN) | |
csString | GetHelpMessage () |
Returns a help message describing the rewards syntax. | |
bool | IsOff () |
Test whether the value is set to off. | |
bool | IsOn () |
Test whether the value is set to on. | |
bool | IsToggle () |
Test whether the value is set to toggle. | |
bool | ParseWord (const csString &word) |
Parses a word that is expected to have on|off|toggle. | |
Public Attributes | |
csString | error |
set to error message when parsing failed | |
ADMINCMD_SETTING_ONOFF | value |
stores on,off,toggle |
Base class for on, off, toggle string Parser.
The class can parse a word for 'on', 'off', 'toggle' and stores the parsed setting internally.
Definition at line 591 of file adminmanager.h.
detected settings recognized by the parser.
ADMINCMD_SETTING_UNKNOWN |
default is unknown setting |
ADMINCMD_SETTING_ON |
when setting is 'on' |
ADMINCMD_SETTING_OFF |
when setting is 'off' |
ADMINCMD_SETTING_TOGGLE |
when setting should be toggled |
Definition at line 596 of file adminmanager.h.
AdminCmdOnOffToggleParser::AdminCmdOnOffToggleParser | ( | ADMINCMD_SETTING_ONOFF | defaultValue = ADMINCMD_SETTING_UNKNOWN | ) |
csString AdminCmdOnOffToggleParser::GetHelpMessage | ( | ) |
Returns a help message describing the rewards syntax.
bool AdminCmdOnOffToggleParser::IsOff | ( | ) |
Test whether the value is set to off.
bool AdminCmdOnOffToggleParser::IsOn | ( | ) |
Test whether the value is set to on.
bool AdminCmdOnOffToggleParser::IsToggle | ( | ) |
Test whether the value is set to toggle.
bool AdminCmdOnOffToggleParser::ParseWord | ( | const csString & | word | ) |
Parses a word that is expected to have on|off|toggle.
Returning true means the word was as expected 'on', 'off' or 'toggle'. Sets the internal variable error when a parsing error occurs.
csString AdminCmdOnOffToggleParser::error |
set to error message when parsing failed
Definition at line 605 of file adminmanager.h.
stores on,off,toggle
Definition at line 604 of file adminmanager.h.