FreeNOS
Public Member Functions
ChangeDirCommand Class Reference
bin » sh

Change the current working directory. More...

#include <ChangeDirCommand.h>

Inheritance diagram for ChangeDirCommand:
ShellCommand

Public Member Functions

 ChangeDirCommand ()
 Constructor function. More...
 
virtual int execute (const Size nparams, const char **params)
 Executes the command. More...
 
- Public Member Functions inherited from ShellCommand
 ShellCommand (const char *name, const Size minParams=0)
 Constructor. More...
 
virtual ~ShellCommand ()
 Destructor. More...
 
const char * getName () const
 Get command name. More...
 
const char * getHelp () const
 Get command help. More...
 
Size getMinimumParams () const
 Get the minimum number of parameters required. More...
 

Additional Inherited Members

- Protected Attributes inherited from ShellCommand
const char * m_name
 Unique name of the command. More...
 
const char * m_help
 Command help text. More...
 
const Size m_minParams
 Minimum number of parameters required. More...
 

Detailed Description

Change the current working directory.

Definition at line 35 of file ChangeDirCommand.h.

Constructor & Destructor Documentation

◆ ChangeDirCommand()

ChangeDirCommand::ChangeDirCommand ( )

Constructor function.

Definition at line 25 of file ChangeDirCommand.cpp.

References ShellCommand::m_help.

Member Function Documentation

◆ execute()

int ChangeDirCommand::execute ( const Size  nparams,
const char **  params 
)
virtual

Executes the command.

Parameters
nparamsNumber of parameters given.
paramsArray of parameters.
Returns
Error code or zero on success.

Implements ShellCommand.

Definition at line 31 of file ChangeDirCommand.cpp.

References chdir(), errno, ERROR, EXIT_FAILURE, EXIT_SUCCESS, ShellCommand::getName(), and strerror().


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