BashSpark
Loading...
Searching...
No Matches
bs::shell_node_command_block_subshell Class Referencefinal

Command block executed in a subshell (may isolate environment changes). More...

#include <shell_node.h>

Inheritance diagram for bs::shell_node_command_block_subshell:
Collaboration diagram for bs::shell_node_command_block_subshell:

Public Member Functions

 shell_node_command_block_subshell (const std::size_t nPos, std::vector< std::unique_ptr< shell_node_evaluable > > &&vSubCommands)
 Construct a subshell command block.
 
shell_status evaluate (shell_session &oSession) const override
 Evaluate the block in a subshell context.
 
const std::vector< std::unique_ptr< shell_node_evaluable > > & get_children () const noexcept
 Access the subshell's subcommands.
 
- Public Member Functions inherited from bs::shell_node_evaluable
 shell_node_evaluable (const shell_node_type nType, const std::size_t nPos)
 Construct an evaluable node.
 
- Public Member Functions inherited from bs::shell_node
virtual ~shell_node ()=default
 Virtual default destructor for polymorphic deletion.
 
shell_node_type get_type () const noexcept
 Get the node type.
 
std::size_t get_pos () const noexcept
 Get node position in the original input stream.
 

Additional Inherited Members

- Protected Member Functions inherited from bs::shell_node
 shell_node (const shell_node_type nType, const std::size_t nPos)
 Protected constructor used by derived classes.
 
- Protected Attributes inherited from bs::shell_node
const shell_node_type m_nType
 Node type.
 
const std::size_t m_nPos
 Position in the input stream.
 

Detailed Description

Command block executed in a subshell (may isolate environment changes).

Constructor & Destructor Documentation

◆ shell_node_command_block_subshell()

bs::shell_node_command_block_subshell::shell_node_command_block_subshell ( const std::size_t  nPos,
std::vector< std::unique_ptr< shell_node_evaluable > > &&  vSubCommands 
)
inline

Construct a subshell command block.

Parameters
nPosPosition in stream.
vSubCommandsSubcommands to run in the subshell.

Member Function Documentation

◆ evaluate()

shell_status bs::shell_node_command_block_subshell::evaluate ( shell_session oSession) const
overridevirtual

Evaluate the block in a subshell context.

Parameters
oSessionSession context.
Returns
shell_status Status from the subshell execution.

Implements bs::shell_node_evaluable.

◆ get_children()

const std::vector< std::unique_ptr< shell_node_evaluable > > & bs::shell_node_command_block_subshell::get_children ( ) const
inlinenoexcept

Access the subshell's subcommands.

Returns
const reference to vector of subcommands.

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