rshell
1.2
|
Parses the string passed to the Command structure into command and parameters. More...
#include <Parse.h>
Public Member Functions | |
Parse_Single_Command (string str) | |
Stores string input passed to the constructor. DO NOT INSTANTIATE THIS CLASS. More... | |
vector< string > | parse () |
Parses a single command into exe and parameters. More... | |
Additional Inherited Members | |
![]() | |
string | input |
Parses the string passed to the Command structure into command and parameters.
Parse_Single_Command::Parse_Single_Command | ( | string | str | ) |
Stores string input passed to the constructor. DO NOT INSTANTIATE THIS CLASS.
Constructor stores the string passed in
|
virtual |
Parses a single command into exe and parameters.
Only the Command class instantiates this class.
The parse function is broken into several steps: STEP 1 - ELIMINATE EXTRANEOUS SPACE NOT IN QUOTES STEP 2 - DIVIDE BY SPACES, |, <, > and >> STEP 3 - REMOVE ANY SETS OF QUOTES STEP 4 - REMOVE ANY EMPTY STRINGS
This parsing function does not handle connectors (&& || or ;) nor does it handle comments (#comments) and it does not expect them in the string. This is because those should have been parsed by Parse_Multi_Command prior to being sent to a Command Class.
Implements Parse.