Question: I should've included this earlier: this is the SimpleShell.h file. I ' m not supposed to change anything in this file.: #ifndef SIMPLE _ SHELL
I should've included this earlier: this is the SimpleShell.h file. Im not supposed to change anything in this file.:
#ifndef SIMPLESHELLH
#define SIMPLESHELLH
#include
#include
#include
#include
#include
Doxygen comment
@brief A simple shell class that handles basic shell operations such as parsing and executing commands.
class SimpleShell
public:
@brief Starts the shell loop.
This method runs the shell's main loop, taking user input, parsing it and executing commands.
void run;
private:
@brief Executes a command using fork and execv.
This function spawns a child process that replaces its image with the command
specified by the user. The parent process waits for the child process to finish.
@param argv A vector containing the command and its arguments to be executed.
void executeconst std::vector& argv;
@brief Parses a line of input into tokens based on a delimiter.
This function takes a string and splits it into tokens, storing each token
into a vector. The delimiter is used to identify where the string should be split.
@param line The input string to be tokenized.
@param tokens A reference to a vector that will hold the parsed tokens.
@param delimiter The delimiter used to split the input string.
void parseconst std::string& line, std::vector& tokens, const std::string& delimiter;
;
#endif SIMPLESHELLH
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
