Functions | |
| bool | executeScopedCommand (const std::string &interpreterName, const std::string &command, const Slot &output, const Slot &error, Progress *pProgress) |
| bool | executeScopedCommand (const std::string &interpreterName, const std::string &command, std::string &outputAndError, bool &hasErrorText, Progress *pProgress) |
| bool | isInterpreterAvailable (const std::string &interpreterName) |
| std::vector< std::string > | getInterpreters () |
| Interpreter * | getInterpreter (const std::string &interpreterName) |
| bool InterpreterUtilities::executeScopedCommand | ( | const std::string & | interpreterName, | |
| const std::string & | command, | |||
| std::string & | outputAndError, | |||
| bool & | hasErrorText, | |||
| Progress * | pProgress | |||
| ) |
Executes the provided statement(s) with the given interpreter while reporting output and error text from command execution.
This function blocks and will not return until all provided statements have been executed to completion.
Variables created while executing the provided command can be created in a nested scope that is closed at command completion causing local variables to be freed. A given interpreter implementation can support this nested scope behavior or can share the global and persistent scope used by Interpreter::executeCommand().
| interpreterName | The name of the interpreter to execute commands with. This should correspond to PlugIn::getName() of the given InterpreterManager instance. | |
| command | The command to execute. This may be a single statement or multiple statements. The syntax for single statements and multi-statements is defined by the given interpreter implementation. | |
| outputAndError | The provided string will be populated with all of the output and error text reported while executing the command. | |
| hasErrorText | The provided bool will be set to true if any error text was reported while executing the command will be set to false if only output text was reported. | |
| pProgress | If a non-NULL progress is provided, the execution of the provided command may report progress to this instance. A given interpreter implementation is permitted to ignore this parameter. An interpreter will only report progress to this progress instance while executing the provided command. |
False if a InterpreterManager instance with the given name cannot not be located or is not already started. Returns false if there was a syntatic problem with the given command, or an exception. was thrown from the interpreter. true will be returned otherwise.| bool InterpreterUtilities::executeScopedCommand | ( | const std::string & | interpreterName, | |
| const std::string & | command, | |||
| const Slot & | output, | |||
| const Slot & | error, | |||
| Progress * | pProgress | |||
| ) |
Executes the provided statement(s) with the given interpreter while reporting output and error text from command execution.
This function blocks and will not return until all provided statements have been executed to completion.
Variables created while executing the provided command can be created in a nested scope that is closed at command completion causing local variables to be freed. A given interpreter implementation can support this nested scope behavior or can share the global and persistent scope used by Interpreter::executeCommand().
| interpreterName | The name of the interpreter to execute commands with. This should correspond to PlugIn::getName() of the given InterpreterManager instance. | |
| command | The command to execute. This may be a single statement or multiple statements. The syntax for single statements and multi-statements is defined by the given interpreter implementation. | |
| output | This Slot will be called as output text is generated from executing this command. The boost::any provided to the slot will contain a std::string with the output text. | |
| error | This Slot will be called as error text is generated from executing this command. The boost::any provided to the slot will contain a std::string with the error text. | |
| pProgress | If a non-NULL progress is provided, the execution of the provided command may report progress to this instance. A given interpreter implementation is permitted to ignore this parameter. An interpreter will only report progress to this progress instance while executing the provided command. |
False if a InterpreterManager instance with the given name cannot not be located or is not already started. Returns false if there was a syntatic problem with the given command, or an exception. was thrown from the interpreter. true will be returned otherwise.| Interpreter* InterpreterUtilities::getInterpreter | ( | const std::string & | interpreterName | ) |
Returns an Interpreter instance for the given name that can be used to execute commands.
| interpreterName | The name of the interpreter to execute commands with. This should correspond to PlugIn::getName() of the given InterpreterManager instance. |
true, otherwise NULL is returned. | std::vector<std::string> InterpreterUtilities::getInterpreters | ( | ) |
Returns the names of all Interpreter implementations (e.g.
all plug-ins that return PlugInManagerServices::InterpreterManagerType() from PlugIn::getType() ). The implementations will be added to the list even if InterpreterManager::isStarted() returns false.
| bool InterpreterUtilities::isInterpreterAvailable | ( | const std::string & | interpreterName | ) |
Queries whether an interpreter is available and has been started.
This function will NOT start the interpreter, it must have already been started using InterpreterManager::start() for this function to return true.
| interpreterName | The name of the interpreter to execute commands with. This should correspond to PlugIn::getName() of the given InterpreterManager instance. |
True if an InterpreterManager instance with the given name can be located and InterpreterManager::isStarted() returns true. Otherwise false is returned.