rshell
1.2
|
Parses a command string into a vector of strings separated by connectors. More...
#include <Parse.h>
Public Member Functions | |
Parse_Multiple_Commands (string str) | |
Stores string input passed to the constructor DO NOT INSTANTIATE THIS CLASS. More... | |
vector< string > | parse () |
Parses a command string into a vector of strings separated by connectors. More... | |
Additional Inherited Members | |
![]() | |
string | input |
Parses a command string into a vector of strings separated by connectors.
Parse_Multiple_Commands::Parse_Multiple_Commands | ( | string | str | ) |
Stores string input passed to the constructor DO NOT INSTANTIATE THIS CLASS.
Constructor stores the string passed in
|
virtual |
Parses a command string into a vector of strings separated by connectors.
The parsing function seperates commands from their connectors passing them into a vector of strings in the format: command1 param1 param2 ... paramN connector1 (&&, || or ;) command2 param1 param2 ... paramN connector2 (&&, || or ;) command3 param1 param2 ... paramN
This is accomplished by using str.find_first_of(string) and processing the substrs accordingly. Commands in () are processed together when found even if they contain &&, || or semicolons.
Implements Parse.