#include <Instruction.hpp>


Public Types | |
| enum | Type { list, ifStatement, doWhileStatement, whileStatement, forStatement, exitStatement, coarseMesh, declaration, affectation, increment, input, decrement, evaluation, blockBegin, blockEnd, output, Using, exec, cat, plot, save, none } |
Public Member Functions | |
| void | execute () |
| InstructionExec (ReferenceCounting< StringExpression > command) | |
| InstructionExec (const InstructionExec &I) | |
| ~InstructionExec () | |
| const Instruction::Type & | type () const |
Protected Attributes | |
| ReferenceCounting < StringExpression > | __command |
| const Instruction::Type | __type |
Definition at line 431 of file Instruction.hpp.
enum Instruction::Type [inherited] |
Definition at line 49 of file Instruction.hpp.
00049 { 00050 list, 00051 ifStatement, 00052 doWhileStatement, 00053 whileStatement, 00054 forStatement, 00055 exitStatement, 00056 coarseMesh, 00057 00058 declaration, 00059 affectation, 00060 increment, 00061 input, 00062 decrement, 00063 evaluation, 00064 00065 blockBegin, 00066 blockEnd, 00067 00068 output, 00069 Using, 00070 exec, 00071 cat, 00072 plot, 00073 save, 00074 none 00075 };
| InstructionExec::InstructionExec | ( | ReferenceCounting< StringExpression > | command | ) |
Definition at line 74 of file Instruction.cpp.
00075 : Instruction(Instruction::exec), 00076 __command(command) 00077 { 00078 ; 00079 }
| InstructionExec::InstructionExec | ( | const InstructionExec & | I | ) |
Definition at line 81 of file Instruction.cpp.
00082 : Instruction(I), 00083 __command(I.__command) 00084 { 00085 ; 00086 }
| InstructionExec::~InstructionExec | ( | ) |
| void InstructionExec::execute | ( | ) | [virtual] |
Implements Instruction.
Definition at line 57 of file Instruction.cpp.
References __command, fferr(), ffout(), and ErrorHandler::normal.
00058 { 00059 __command->execute(); 00060 std::string command = __command->value(); 00061 ffout(2) << "executing: " << command << '\n'; 00062 #ifdef ALLOW_EXEC 00063 int result = system(command.c_str()); 00064 if (result == -1) { 00065 throw ErrorHandler(__FILE__,__LINE__, 00066 "could not execute: "+command, 00067 ErrorHandler::normal); 00068 } 00069 #else // ALLOW_EXEC 00070 fferr(2) << "warning: this version was not compiled with 'exec' support.\n"; 00071 #endif // ALLOW_EXEC 00072 }

| const Instruction::Type& Instruction::type | ( | ) | const [inline, inherited] |
Definition at line 81 of file Instruction.hpp.
References Instruction::__type.
00082 { 00083 return __type; 00084 }
ReferenceCounting<StringExpression> InstructionExec::__command [protected] |
const Instruction::Type Instruction::__type [protected, inherited] |
1.5.6