rshell  1.2
Parse_Multiple_Commands Class Reference

Parses a command string into a vector of strings separated by connectors. More...

#include <Parse.h>

Inheritance diagram for Parse_Multiple_Commands:
Parse

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

- Protected Attributes inherited from Parse
string input
 

Detailed Description

Parses a command string into a vector of strings separated by connectors.

Constructor & Destructor Documentation

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

Member Function Documentation

vector< string > Parse_Multiple_Commands::parse ( )
virtual

Parses a command string into a vector of strings separated by connectors.

Returns
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.


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