Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

Autoexec Class Reference

class handling autoexecution of commands at the startup. More...

#include <autoexec.h>

List of all members.

Public Member Functions

void addCommand (csString name, csString cmd)
 Adds commands to the autoexec list.
 Autoexec ()
 Constructor.
void execute ()
 Triggers the autoexec to run the commands.
csString getCommands (csString name)
 Gets commands of one character name.
bool GetEnabled ()
 Gets if the autoexec is enabled and will trigger.
void LoadDefault ()
 Overrides the current autoexec data with default.
void SaveCommands ()
 Save all the autoexec data to file.
void SetEnabled (const bool en)
 Sets if the autoexec is enabled and will trigger.
 ~Autoexec ()
 Destructor.

Protected Member Functions

void LoadCommands (const char *fileName)
 Loads the autoexec data with the provided file name.

Protected Attributes

csArray< AutoexecCommandcmds
 Stores all the commands which are in the data file.
bool enabled
 Stores if the autoexec functionality is enabled.

Detailed Description

class handling autoexecution of commands at the startup.

Definition at line 36 of file autoexec.h.


Constructor & Destructor Documentation

Autoexec::Autoexec ( )

Constructor.

Autoexec::~Autoexec ( )

Destructor.


Member Function Documentation

void Autoexec::addCommand ( csString  name,
csString  cmd 
)

Adds commands to the autoexec list.

Parameters:
nameThe character name for which the cmd string will be executed.
cmdThe string of commands to execute automatically.
void Autoexec::execute ( )

Triggers the autoexec to run the commands.

csString Autoexec::getCommands ( csString  name)

Gets commands of one character name.

Parameters:
nameThe name for which to search for the commands. An empty string for the general ones.
Returns:
The string with all the commands of the requested type.
bool Autoexec::GetEnabled ( ) [inline]

Gets if the autoexec is enabled and will trigger.

Returns:
True if the autoexec functionality is enabled.

Definition at line 45 of file autoexec.h.

void Autoexec::LoadCommands ( const char *  fileName) [protected]

Loads the autoexec data with the provided file name.

Parameters:
fileNameThe vfs filename where to find the command list
void Autoexec::LoadDefault ( )

Overrides the current autoexec data with default.

void Autoexec::SaveCommands ( )

Save all the autoexec data to file.

void Autoexec::SetEnabled ( const bool  en) [inline]

Sets if the autoexec is enabled and will trigger.

Parameters:
enSet this true if you want to activate the autoexec functionality.

Definition at line 49 of file autoexec.h.


Member Data Documentation

Stores all the commands which are in the data file.

Definition at line 69 of file autoexec.h.

bool Autoexec::enabled [protected]

Stores if the autoexec functionality is enabled.

Definition at line 68 of file autoexec.h.


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