Container for all the file system operations.
More...
#include <FileCommands.hxx>
|
| static Console::CommandStatus | cat_command (FILE *fp, int argc, const char *argv[], void *context) |
| | Concatinate files.
|
| |
| static Console::CommandStatus | echo_command (FILE *fp, int argc, const char *argv[], void *context) |
| | Echo string.
|
| |
| static Console::CommandStatus | rm_command (FILE *fp, int argc, const char *argv[], void *context) |
| | Remove files or directories.
|
| |
| static Console::CommandStatus | ls_command (FILE *fp, int argc, const char *argv[], void *context) |
| | List directory contents.
|
| |
| static void | ls_printline (FILE *fp, const char *name, struct stat *stat) |
| | Helper method to print a single "ls" line.
|
| |
Container for all the file system operations.
This class can be used by intantiating an instance of FileCommands and passing to the constructor a Console instance reference. The commands implemented by FileCommands will be added to the Console instance.
Definition at line 45 of file FileCommands.hxx.
◆ FileCommands()
| FileCommands::FileCommands |
( |
Console * |
console | ) |
|
|
inline |
Constructor.
- Parameters
-
| console | console instance to add the commands to |
Definition at line 50 of file FileCommands.hxx.
◆ cat_command()
| static Console::CommandStatus FileCommands::cat_command |
( |
FILE * |
fp, |
|
|
int |
argc, |
|
|
const char * |
argv[], |
|
|
void * |
context |
|
) |
| |
|
inlinestaticprivate |
Concatinate files.
- Parameters
-
| fp | file pointer to console |
| argc | number of arguments including the command itself |
| argv | array of arguments starting with the command itself |
| context | unused |
- Returns
- COMMAND_OK
Definition at line 66 of file FileCommands.hxx.
◆ echo_command()
| static Console::CommandStatus FileCommands::echo_command |
( |
FILE * |
fp, |
|
|
int |
argc, |
|
|
const char * |
argv[], |
|
|
void * |
context |
|
) |
| |
|
inlinestaticprivate |
Echo string.
- Parameters
-
| fp | file pointer to console |
| argc | number of arguments including the command itself |
| argv | array of arguments starting with the command itself |
| context | unused |
- Returns
- COMMAND_OK
Definition at line 109 of file FileCommands.hxx.
◆ ls_command()
| static Console::CommandStatus FileCommands::ls_command |
( |
FILE * |
fp, |
|
|
int |
argc, |
|
|
const char * |
argv[], |
|
|
void * |
context |
|
) |
| |
|
inlinestaticprivate |
List directory contents.
- Parameters
-
| fp | file pointer to console |
| argc | number of arguments including the command itself |
| argv | array of arguments starting with the command itself |
| context | unused |
- Returns
- COMMAND_OK
Definition at line 190 of file FileCommands.hxx.
◆ ls_printline()
| static void FileCommands::ls_printline |
( |
FILE * |
fp, |
|
|
const char * |
name, |
|
|
struct stat * |
stat |
|
) |
| |
|
inlinestaticprivate |
Helper method to print a single "ls" line.
- Parameters
-
| fp | file pointer to console |
| name | name of the entry |
| stat | status information about the entry |
Definition at line 244 of file FileCommands.hxx.
◆ rm_command()
| static Console::CommandStatus FileCommands::rm_command |
( |
FILE * |
fp, |
|
|
int |
argc, |
|
|
const char * |
argv[], |
|
|
void * |
context |
|
) |
| |
|
inlinestaticprivate |
Remove files or directories.
- Parameters
-
| fp | file pointer to console |
| argc | number of arguments including the command itself |
| argv | array of arguments starting with the command itself |
| context | unused |
- Returns
- COMMAND_OK
Definition at line 153 of file FileCommands.hxx.
The documentation for this class was generated from the following file: