rshell  1.2
Parse_Single_Command Class Reference

Parses the string passed to the Command structure into command and parameters. More...

#include <Parse.h>

Inheritance diagram for Parse_Single_Command:
Parse

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

- Protected Attributes inherited from Parse
string input
 

Detailed Description

Parses the string passed to the Command structure into command and parameters.

Constructor & Destructor Documentation

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

Member Function Documentation

vector< string > Parse_Single_Command::parse ( )
virtual

Parses a single command into exe and parameters.

Returns
a vector of strings where the first element is the exe and following are each parameter

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.


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