|
|
|
|
|
|
|
|
OutputBuffer.append(O.str());
|
|
|
OutputBuffer.append(O.str());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
void Job::emitResponsePrevix() {
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Job::emitOK() {
|
|
|
void Job::emitOK() {
|
|
|
|
|
|
ostringstream O;
|
|
|
|
|
|
O << CurrentCommand.Number << " OK" << endl;
|
|
|
|
|
|
OutputBuffer.append(O.str());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const string INTFVersion = "1";
|
|
|
|
|
|
|
|
|
void Job::emitINTF() {
|
|
|
void Job::emitINTF() {
|
|
|
|
|
|
ostringstream O;
|
|
|
|
|
|
O << CurrentCommand.Number << " INTF " << INTFVersion << endl;
|
|
|
|
|
|
OutputBuffer.append(O.str());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
void Job::emitFAIL() {
|
|
|
|
|
|
|
|
|
void Job::emitFAILURE() {
|
|
|
|
|
|
ostringstream O;
|
|
|
|
|
|
O << CurrentCommand.Number << " FAILURE" << endl;
|
|
|
|
|
|
OutputBuffer.append(O.str());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string formatAsCGPString(const string& S) {
|
|
|
|
|
|
string CGPString;
|
|
|
|
|
|
CGPString.push_back('"');
|
|
|
|
|
|
for(size_t i = 0; i < S.length(); i++) {
|
|
|
|
|
|
char C = S[i];
|
|
|
|
|
|
switch(C) {
|
|
|
|
|
|
case '\r': break;
|
|
|
|
|
|
case '\t': { CGPString.append("\\t"); break; }
|
|
|
|
|
|
case '\n': { CGPString.append("\\e"); break; }
|
|
|
|
|
|
case '\\': { CGPString.append("\\"); break; }
|
|
|
|
|
|
case '"': { CGPString.append("\\\""); break; }
|
|
|
|
|
|
default: CGPString.push_back(C);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
CGPString.push_back('"');
|
|
|
|
|
|
return CGPString;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
void Job::emitADDHEADER(string Headers) {
|
|
|
void Job::emitADDHEADER(string Headers) {
|
|
|
|
|
|
ostringstream O;
|
|
|
|
|
|
O << CurrentCommand.Number << " ADDHEADER " << formatAsCGPString(Headers) << endl;
|
|
|
|
|
|
OutputBuffer.append(O.str());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
void Job::emitERROR() {
|
|
|
|
|
|
|
|
|
void Job::emitERROR(string Report) {
|
|
|
|
|
|
ostringstream O;
|
|
|
|
|
|
O << CurrentCommand.Number << " ERROR " << formatAsCGPString(Report) << endl;
|
|
|
|
|
|
OutputBuffer.append(O.str());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
void Job::emitDISCARD() {
|
|
|
void Job::emitDISCARD() {
|
|
|
|
|
|
ostringstream O;
|
|
|
|
|
|
O << CurrentCommand.Number << " DISCARD" << endl;
|
|
|
|
|
|
OutputBuffer.append(O.str());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Job::emitREJECTED(string Report) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
void Job::finalize() {
|
|
|
void Job::finalize() {
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
void Job::doINTF() {
|
|
|
void Job::doINTF() {
|
|
|
|
|
|
emitINTF();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
void Job::doFAIL() {
|
|
|
void Job::doFAIL() {
|
|
|
|
|
|
ostringstream O;
|
|
|
|
|
|
O << "SNF4CGP Does not understand: " << formatAsCGPString(CurrentCommand.Data);
|
|
|
|
|
|
emitComment(O.str());
|
|
|
|
|
|
emitFAILURE();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
void Job::doFILE() {
|
|
|
void Job::doFILE() {
|