Changeset 10976
- Timestamp:
- 06/10/11 10:54:16 (14 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Readline.cc
r10922 r10976 114 114 if (read_history(fName.c_str())) 115 115 cout << "WARNING - Reading " << fName << ": " << strerror(errno) << endl; 116 117 fCommandLog.open(string(prgname)+".evt"); 116 118 117 119 // Setup the readline callback which are needed to redirect … … 943 945 bool Readline::Process(const string &str) 944 946 { 947 fCommandLog << str << endl; 948 945 949 if (str.substr(0, 3)==".w ") 946 950 { … … 1111 1115 int rc = 0; 1112 1116 1113 ifstream fin(Tools::Trim(fname).c_str()); 1117 const string name = Tools::Trim(fname); 1118 1119 ifstream fin(name.c_str()); 1114 1120 if (!fin) 1115 1121 return -1; 1122 1123 fCommandLog << "# START executing: " << name << endl; 1116 1124 1117 1125 string buffer; … … 1126 1134 1127 1135 rc++; 1128 1136 // FIXME: Write command log 1129 1137 if (Process(buffer)) 1130 1138 continue; … … 1134 1142 AddToHistory(buffer); 1135 1143 } 1144 1145 fCommandLog << "# FINISHED executing: " << name << endl; 1136 1146 1137 1147 return rc; -
trunk/FACT++/src/Readline.h
r10654 r10976 4 4 #include <string> 5 5 #include <vector> 6 #include <fstream> 6 7 7 8 class Readline … … 19 20 std::string fName; /// Filename for the history file compiled in the constructor 20 21 int fMaxLines; /// Maximum number of lines in the history file 22 23 std::ofstream fCommandLog; 21 24 22 25 std::string fLastLine; /// Last line adde to history
Note:
See TracChangeset
for help on using the changeset viewer.