COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
Command Line and script interpreter. More...
#include <Interpreter.hpp>
Public Member Functions | |
Interpreter (const commands_description &desc) | |
Constructor, taking description of commands. More... | |
Interpreter (const commands_description &desc, const prompt_function_pointer_t &prompt) | |
Constructor taking description of commands and prompt function. More... | |
std::vector< std::string > | split_command_line (const std::string &input) |
splits a command_line in words More... | |
void | handle_read_line (std::string line) |
function that handles a command-line More... | |
void | interpret (std::istream &input_stream) |
Start interpreting an input_stream. More... | |
void | interpret (std::istream &input_stream, readline_function_pointer_t f) |
void | interpret (int argc, char *argv[]) |
interpret command line style arguments More... | |
void | write_prompt () |
Output the prompt. More... | |
void | description (const commands_description &desc) |
void | notify (boost::program_options::variables_map &vm) |
void | alias (const std::string &arg) |
void | interpret_alias (std::vector< std::string > &unrecognized_commands) |
Private Types | |
typedef std::string(* | prompt_function_pointer_t) () |
typedef std::string(* | readline_function_pointer_t) (const std::string &line) |
typedef boost::function< void(std::vector< std::string > &) > | unrecognized_commands_handler_t |
Private Attributes | |
commands_description | m_desc |
const prompt_function_pointer_t | m_prompt |
std::vector< unrecognized_commands_handler_t > | m_handle_unrecognized_commands |
std::deque< std::string > | m_history |
std::map< std::string, std::string > | m_alias |
Command Line and script interpreter.
Based on boost::program_options. Line by line from a script is interpreted, treating every line as boost::program_options arguments
Definition at line 43 of file Interpreter.hpp.
|
private |
Definition at line 47 of file Interpreter.hpp.
|
private |
Definition at line 48 of file Interpreter.hpp.
|
private |
Definition at line 51 of file Interpreter.hpp.
Interpreter | ( | const commands_description & | desc | ) |
Constructor, taking description of commands.
Definition at line 56 of file Interpreter.cpp.
Interpreter | ( | const commands_description & | desc, |
const prompt_function_pointer_t & | prompt | ||
) |
Constructor taking description of commands and prompt function.
Definition at line 67 of file Interpreter.cpp.
void alias | ( | const std::string & | arg | ) |
Definition at line 115 of file Interpreter.cpp.
void description | ( | const commands_description & | desc | ) |
Definition at line 77 of file Interpreter.cpp.
void handle_read_line | ( | std::string | line | ) |
function that handles a command-line
Definition at line 204 of file Interpreter.cpp.
void interpret | ( | std::istream & | input_stream | ) |
Start interpreting an input_stream.
Definition at line 413 of file Interpreter.cpp.
void interpret | ( | std::istream & | input_stream, |
readline_function_pointer_t | f | ||
) |
Start interpreting and input_stream, and use a function to modify each line before it gets handled.
Definition at line 438 of file Interpreter.cpp.
void interpret | ( | int | argc, |
char * | argv[] | ||
) |
interpret command line style arguments
Definition at line 270 of file Interpreter.cpp.
void interpret_alias | ( | std::vector< std::string > & | unrecognized_commands | ) |
Definition at line 94 of file Interpreter.cpp.
void notify | ( | boost::program_options::variables_map & | vm | ) |
Definition at line 344 of file Interpreter.cpp.
std::vector< std::string > split_command_line | ( | const std::string & | input | ) |
splits a command_line in words
Definition at line 127 of file Interpreter.cpp.
void write_prompt | ( | ) |
Output the prompt.
Definition at line 466 of file Interpreter.cpp.
|
private |
Definition at line 94 of file Interpreter.hpp.
|
private |
Definition at line 90 of file Interpreter.hpp.
|
private |
Definition at line 92 of file Interpreter.hpp.
|
private |
Definition at line 93 of file Interpreter.hpp.
|
private |
Definition at line 91 of file Interpreter.hpp.
Send comments to: COOLFluiD Web Admin |