Selaa lähdekoodia

Refactored command comment reporting

git-svn-id: https://svn.microneil.com/svn/SNF4CGP/trunk@30 59e8e3e7-56fa-483b-b4b4-fa6ab0af3dfc
master
madscientist 15 vuotta sitten
vanhempi
commit
3493f12b56
2 muutettua tiedostoa jossa 17 lisäystä ja 6 poistoa
  1. 16
    6
      SNF4CGP/JobPool.cpp
  2. 1
    0
      SNF4CGP/JobPool.hpp

+ 16
- 6
SNF4CGP/JobPool.cpp Näytä tiedosto

@@ -31,6 +31,10 @@ void Job::emitComment(const string& Comment) {
OutputBuffer.append(O.str());
}
void Job::generateCommandCommentPrefix(ostringstream& O) {
O << "* SNF4CGP[" << CurrentCommand.Number << "] ";
}
void Job::emitOK() {
ostringstream O;
O << CurrentCommand.Number << " OK" << endl;
@@ -230,20 +234,23 @@ void convertLogLinesToComments(ostringstream& O, string& Lines) {
void Job::emitLogComment() {
ostringstream O;
O << "* SNF4CGP[" << CurrentCommand.Number << "] Comment: " << ScanResultConfiguration.LogComment << endl;
generateCommandCommentPrefix(O);
O << "Comment: " << ScanResultConfiguration.LogComment << endl;
OutputBuffer.append(O.str());
}
void Job::emitXMLLogData() {
ostringstream O;
O << "* SNF4CGP[" << CurrentCommand.Number << "] XML Scan log data: " << endl;
generateCommandCommentPrefix(O);
O << "XML Scan log data: " << endl;
convertLogLinesToComments(O, XMLLogData);
OutputBuffer.append(O.str());
}
void Job::emitClassicLogData() {
ostringstream O;
O << "* SNF4CGP[" << CurrentCommand.Number << "] Classic Scan log data: " << endl;
generateCommandCommentPrefix(O);
O << "Classic Scan log data: " << endl;
convertLogLinesToComments(O, ClassicLogData);
OutputBuffer.append(O.str());
}
@@ -283,7 +290,8 @@ void Job::doDelete() {
void Job::emitMessageMovedTo(string& Destination) {
ostringstream O;
O << "* SNF4CGP[" << CurrentCommand.Number << "] Moved message to " << Destination << endl;
generateCommandCommentPrefix(O);
O << "Moved message to " << Destination << endl;
OutputBuffer.append(O.str());
}
@@ -486,13 +494,15 @@ void Job::executeCommand() {
void Job::emitException(const string& What) {
ostringstream O;
O << "* SNF4CGP[" << CurrentCommand.Number << "] Exception: " << What << endl;
generateCommandCommentPrefix(O);
O << "Exception: " << What << endl;
OutputBuffer.append(O.str());
}
void Job::emitUnknownException() {
ostringstream O;
O << "* SNF4CGP[" << CurrentCommand.Number << "] Unknown Exception!" << endl;
generateCommandCommentPrefix(O);
O << "Unknown Exception!" << endl;
OutputBuffer.append(O.str());
}

+ 1
- 0
SNF4CGP/JobPool.hpp Näytä tiedosto

@@ -89,6 +89,7 @@ class Job {
//// Utility methods
void emitComment(const string& Comment);
void generateCommandCommentPrefix(ostringstream& O);
void emitOK();
void emitINTF();

Loading…
Peruuta
Tallenna