Go to the documentation of this file.
45 using std::stable_sort;
51 result_(NULL), errorState_(
false), finalized_(
false) {
60 string method =
"ScriptInterpreter::~ScriptInterpreter()";
61 string message =
"Interpreter not finalized.";
217 result->setString(errorMessage);
241 const std::string& interpreterVariableName,
242 const std::string& value) {
257 const std::string& interpreterVariableName,
274 const std::string& interpreterVariableName) {
289 const std::string& interpreterVariableName) {
304 ifstream fileStream(scriptFileName.c_str());
306 if (fileStream.bad()) {
307 string method =
"ScriptInterpreter::processScriptFile";
308 string message =
"Cannot open file " + scriptFileName;
313 while (getline(fileStream, line)) {
344 vector<string> names;
348 names.push_back((*it).second->name());
352 vector<string>::iterator first = names.begin();
353 vector<string>::iterator last = names.end();
354 stable_sort(first , last);
virtual std::string result()
virtual void setDouble(double value)
virtual std::string stringValue() const
static void writeToErrorLog(const std::string fileName, const int lineNumber, const std::string functionName, const std::string message, const int neededVerbosity=0)
virtual DataObject variable(const std::string &name)=0
void setInterpreter(ScriptInterpreter *si)
virtual void setInteger(int value)
virtual int variableIntegerValue(const std::string &interpreterVariableName)
std::map< std::string, CustomCommand * > commands_
Map containing all custom commands for interpreter.
LineReader * reader_
LineReader for interpreter.
virtual void setVariableToInterpreter(const std::string &name, const DataObject &value)=0
bool errorState_
Indicates whether we are in error state.
DataObject * result_
The latest interpreter result.
virtual void addCustomCommandToInterpreter(const CustomCommand &command)=0
virtual int integerValue() const
virtual ~ScriptInterpreter()
virtual void setLineReader(LineReader *reader)
virtual bool processScriptFile(const std::string &scriptFileName)
std::map< std::string, CustomCommand * >::value_type ValType
val_type for map.
std::vector< std::string > customCommandsSortedByName()
virtual void removeCustomCommand(const std::string &commandName)
virtual bool error() const
virtual void removeCustomCommandFromInterpreter(const CustomCommand &command)=0
virtual bool interpret(const std::string &commandLine)=0
virtual CustomCommand * customCommand(const std::string &commandName)
virtual void setResult(DataObject *result)
find Finds info of the inner loops in the false
std::map< std::string, CustomCommand * >::iterator MapIter
Iterator for map.
virtual void setVariable(const std::string &interpreterVariableName, const std::string &value)
virtual void setError(bool state)
virtual void setString(std::string value)
virtual std::string variableStringValue(const std::string &interpreterVariableName)
virtual LineReader * lineReader() const
virtual void setResultToInterpreter(const DataObject &value)=0
virtual void addCustomCommand(CustomCommand *command)
bool finalized_
True if Interpreter is finalized.