Represents an environment for shell commands.
More...
#include <shell_vtable.h>
|
|
| shell_vtable ()=default |
| | Default constructor (empty environment).
|
| |
| const func_type * | get_func (const std::string &sVar) const |
| | Gets a function.
|
| |
| void | set_func (const std::string &sName, const func_type *pFunction) |
| | Sets the a function.
|
| |
| bool | has_func (const std::string &sName) const noexcept |
| | Checks if a function exists.
|
| |
| std::size_t | get_vtable_size () const noexcept |
| | Gets the number of functions in the vtable.
|
| |
| const std::unordered_map< std::string, const func_type *, shell_hash > & | get_env () const noexcept |
| | Retrieves all environment variables.
|
| |
Represents an environment for shell commands.
This class manages environment variables.
◆ get_env()
| const std::unordered_map< std::string, const func_type *, shell_hash > & bs::shell_vtable::get_env |
( |
| ) |
const |
|
inlinenoexcept |
Retrieves all environment variables.
- Returns
- A const reference to the map of environment variables.
◆ get_func()
| const func_type * bs::shell_vtable::get_func |
( |
const std::string & |
sVar | ) |
const |
|
inline |
Gets a function.
- Parameters
-
| sVar | The name of the function to get |
- Returns
- The function if there is or nullptr
◆ get_vtable_size()
| std::size_t bs::shell_vtable::get_vtable_size |
( |
| ) |
const |
|
inlinenoexcept |
Gets the number of functions in the vtable.
- Returns
- The size of the function map.
◆ has_func()
| bool bs::shell_vtable::has_func |
( |
const std::string & |
sName | ) |
const |
|
inlinenoexcept |
Checks if a function exists.
- Parameters
-
| sName | The name of the function. |
- Returns
- True if the function exists, false otherwise.
◆ set_func()
| void bs::shell_vtable::set_func |
( |
const std::string & |
sName, |
|
|
const func_type * |
pFunction |
|
) |
| |
|
inline |
Sets the a function.
- Parameters
-
| sName | The name of the function. |
| pFunction | The function to be set. |
The documentation for this class was generated from the following file:
- /home/runner/work/bashspark/bashspark/include/BashSpark/shell/shell_vtable.h