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. More... | |
bool | IsOff () |
Test whether the value is set to off. More... | |
bool | IsOn () |
Test whether the value is set to on. More... | |
bool | IsToggle () |
Test whether the value is set to toggle. More... | |
bool | ParseWord (const csString &word) |
Parses a word that is expected to have on|off|toggle. More... | |
Public Attributes | |
csString | error |
set to error message when parsing failed More... | |
ADMINCMD_SETTING_ONOFF | value |
stores on,off,toggle More... | |
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.
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.
ADMINCMD_SETTING_ONOFF AdminCmdOnOffToggleParser::value |
stores on,off,toggle
Definition at line 604 of file adminmanager.h.