Planeshift
Public Types | Public Member Functions | Public Attributes

AdminCmdOnOffToggleParser Class Reference

Base class for on, off, toggle string Parser. More...

#include <adminmanager.h>

List of all members.

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

Detailed Description

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.


Member Enumeration Documentation

detected settings recognized by the parser.

Enumerator:
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.


Constructor & Destructor Documentation

AdminCmdOnOffToggleParser::AdminCmdOnOffToggleParser ( ADMINCMD_SETTING_ONOFF  defaultValue = ADMINCMD_SETTING_UNKNOWN)

Member Function Documentation

csString AdminCmdOnOffToggleParser::GetHelpMessage ( )

Returns a help message describing the rewards syntax.

Returns:
csString: help message for the rewards syntax
bool AdminCmdOnOffToggleParser::IsOff ( )

Test whether the value is set to off.

Returns:
bool: true when value is ADMINCMD_SETTING_OFF
bool AdminCmdOnOffToggleParser::IsOn ( )

Test whether the value is set to on.

Returns:
bool: true when value is ADMINCMD_SETTING_ON
bool AdminCmdOnOffToggleParser::IsToggle ( )

Test whether the value is set to toggle.

Returns:
bool: true when value is ADMINCMD_SETTING_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.

Returns:
bool: true when parsing succeeds, otherwise false

Member Data Documentation

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.


The documentation for this class was generated from the following file: