InstructionCat Class Reference

#include <Instruction.hpp>

Inheritance diagram for InstructionCat:

Inheritance graph
[legend]
Collaboration diagram for InstructionCat:

Collaboration graph
[legend]

List of all members.

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 ()
 InstructionCat (ReferenceCounting< StringExpression > command)
 InstructionCat (const InstructionCat &I)
 ~InstructionCat ()
const Instruction::Typetype () const

Protected Attributes

ReferenceCounting
< StringExpression
__filename
const Instruction::Type __type


Detailed Description

Definition at line 454 of file Instruction.hpp.


Member Enumeration Documentation

enum Instruction::Type [inherited]

Enumerator:
list 
ifStatement 
doWhileStatement 
whileStatement 
forStatement 
exitStatement 
coarseMesh 
declaration 
affectation 
increment 
input 
decrement 
evaluation 
blockBegin 
blockEnd 
output 
Using 
exec 
cat 
plot 
save 
none 

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   };


Constructor & Destructor Documentation

InstructionCat::InstructionCat ( ReferenceCounting< StringExpression command  ) 

Definition at line 114 of file Instruction.cpp.

00115   : Instruction(Instruction::cat),
00116     __filename(filename)
00117 {
00118   ;
00119 }

InstructionCat::InstructionCat ( const InstructionCat I  ) 

Definition at line 122 of file Instruction.cpp.

00123   : Instruction(I),
00124     __filename(I.__filename)
00125 {
00126   ;
00127 }

InstructionCat::~InstructionCat (  ) 

Definition at line 130 of file Instruction.cpp.

00131 {
00132   ;
00133 }


Member Function Documentation

void InstructionCat::execute (  )  [virtual]

Implements Instruction.

Definition at line 94 of file Instruction.cpp.

References __filename, ffout(), and ErrorHandler::normal.

00095 {
00096   __filename->execute();
00097 
00098   const std::string filename = __filename->value();
00099   std::ifstream fin(filename.c_str());
00100 
00101   if (not fin) {
00102     throw ErrorHandler(__FILE__,__LINE__,
00103                        "could not open file \""+filename+"\"",
00104                        ErrorHandler::normal);
00105   }
00106   char c = fin.get();
00107   while (not(fin.eof())) {
00108     ffout(0) << c;
00109     c = fin.get();
00110   }
00111 }

Here is the call graph for this function:

const Instruction::Type& Instruction::type (  )  const [inline, inherited]

Definition at line 81 of file Instruction.hpp.

References Instruction::__type.

00082   {
00083     return __type;
00084   }


Member Data Documentation

Definition at line 458 of file Instruction.hpp.

Referenced by execute().

const Instruction::Type Instruction::__type [protected, inherited]

Definition at line 78 of file Instruction.hpp.

Referenced by Instruction::type().


The documentation for this class was generated from the following files:

Generated on Wed Nov 19 00:07:58 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6