#include <JobCInterpreter.h>
Public Member Functions | |
| JobCInterpreter () | |
| JobCInterpreter (bool echo) | |
| ~JobCInterpreter () | |
| void | ReadFile (const string &filename) |
| void | EchoOn () |
| void | EchoOff () |
| JobCommand * | PopJobCommand () |
Private Member Functions | |
| void | Interp (const char *cmd) |
| void | PushJobCommand (JobCommand *c) |
Private Attributes | |
| bool | fEchoCommand |
| string | fBuffer |
| unsigned int | fCmdIndx |
| vector< JobCommand * > | fCmdList |
Friends | |
| class JobCInterpreter & | operator<< (JobCInterpreter &jci, const char *c) |
|
|
Definition at line 22 of file JobCInterpreter.cxx. 00022 : 00023 fEchoCommand(false),fBuffer(""), fCmdIndx(0) { }
|
|
|
Definition at line 27 of file JobCInterpreter.cxx. References echo(). 00027 : 00028 fEchoCommand(echo),fBuffer(""), fCmdIndx(0) { }
|
|
|
Definition at line 32 of file JobCInterpreter.cxx. References fCmdList. 00033 {
00034 // Delete the job commands in the history list
00035 vector<JobCommand*>::iterator itrend(fCmdList.end());
00036 vector<JobCommand*>::iterator itr;
00037 for (itr = fCmdList.begin(); itr != itrend; ++itr) {
00038 delete *itr;
00039 }
00040 }
|
|
|
Definition at line 52 of file JobCInterpreter.cxx. References fEchoCommand. Referenced by JobController::ControllerCommand(). 00052 { fEchoCommand = false; }
|
|
|
Definition at line 48 of file JobCInterpreter.cxx. References fEchoCommand. Referenced by JobController::ControllerCommand(). 00048 { fEchoCommand = true; }
|
|
|
Definition at line 80 of file JobCInterpreter.cxx. References fBuffer, and PushJobCommand(). Referenced by operator<<(). 00081 {
00082 const char *c = cmd;
00083
00084 // Skip lines starting with '#'
00085 if (*c == '#') return;
00086
00087 // Skip leading white space
00088 if (fBuffer.length()==0) while (*c == ' ') ++c;
00089
00090 // Add to current string buffer
00091 for (; *c!='\0'; ++c) {
00092 // Don't read pass continuation flags
00093 if (*c=='\\') return;
00094
00095 // Don't read pass comments
00096 if (*c=='/' && *(c+1)=='/') {
00097 if (fBuffer.length()>0) {
00098 JobCommand *jcmd = new JobCommand(fBuffer.c_str());
00099 this->PushJobCommand(jcmd);
00100 fBuffer = "";
00101 }
00102 return;
00103 }
00104
00105 // Parse what we have
00106 if (*c=='\n' || *c==';') {
00107 if (fBuffer.length()>0) {
00108 JobCommand *jcmd = new JobCommand(fBuffer.c_str());
00109 this->PushJobCommand(jcmd);
00110 fBuffer = "";
00111 }
00112 }
00113 else {
00114 if (*c == ' ' && fBuffer.length()==0) continue;
00115 else fBuffer += (*c);
00116 }
00117 }
00118 }
|
|
|
Definition at line 56 of file JobCInterpreter.cxx. References fCmdIndx, fCmdList, jc, and MSG. Referenced by JobController::ProcessCommands(). 00057 {
00058 //======================================================================
00059 // Return the next command in the list
00060 //======================================================================
00061 if (fCmdIndx<fCmdList.size()) {
00062 JobCommand *jc = fCmdList[fCmdIndx++];
00063 if (jc) {
00064 if (fEchoCommand) MSG("JobC",Msg::kInfo) << "jobc> " << (*jc) << "\n";
00065 return jc;
00066 }
00067 }
00068 return 0;
00069 }
|
|
|
Definition at line 73 of file JobCInterpreter.cxx. References fCmdList. Referenced by Interp(). 00074 {
00075 fCmdList.push_back(c);
00076 }
|
|
|
Definition at line 44 of file JobCInterpreter.cxx. 00044 { }
|
|
||||||||||||
|
Definition at line 14 of file JobCInterpreter.cxx. 00015 {
00016 jci.Interp(c);
00017 return jci;
00018 }
|
|
|
Definition at line 39 of file JobCInterpreter.h. Referenced by Interp(). |
|
|
Definition at line 40 of file JobCInterpreter.h. Referenced by PopJobCommand(). |
|
|
Definition at line 41 of file JobCInterpreter.h. Referenced by PopJobCommand(), PushJobCommand(), and ~JobCInterpreter(). |
|
|
Definition at line 38 of file JobCInterpreter.h. |
1.3.9.1