From: <vo...@us...> - 2006-03-29 11:02:52
|
Update of /cvsroot/synce/vdccm/testtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6356/testtools Modified Files: proxyclientsocket.cpp Log Message: code-rearangement Index: proxyclientsocket.cpp =================================================================== RCS file: /cvsroot/synce/vdccm/testtools/proxyclientsocket.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- proxyclientsocket.cpp 28 Mar 2006 23:11:32 -0000 1.4 +++ proxyclientsocket.cpp 29 Mar 2006 11:02:47 -0000 1.5 @@ -49,22 +49,30 @@ uint32_t length = *(uint32_t *) buf; char lineBuf[8]; - cout << "0x" << hex << setw(4) << setfill('0') << 0 << " " << flush; + cout << "0x" << hex << setw(8) << setfill('0') << 0 << " " << flush; for (int i = 0; i < length + 4; i++) { cout << "0x" << hex << setw(2) << setfill('0') << (int) buf[i] << " " << flush; lineBuf[i % 8] = buf[i]; if ((i + 1) % 8 == 0) { - cout << " " << flush; + cout << " " << flush; for (int n = 0; n < 8; n++) { char out = (isprint(lineBuf[n]) ? lineBuf[n] : '.'); cout << out << flush; } cout << endl; if ((i + 1) < length + 4) { - cout << "0x" << hex << setw(4) << setfill('0') << i + 1 << " " << flush; + cout << "0x" << hex << setw(8) << setfill('0') << i + 1 << " " << flush; } } else if (i + 1 == length + 4) { - cout << endl; + int count = (i + 1) % 8; + for (int n = 1; n < (8 - count) * 5 + 2; n++) { + std::cout << " " << std::flush; + } + for (int n = 0; n < count; n++) { + char out = ( isprint( lineBuf[ n ] ) ? lineBuf[ n ] : '.' ); + std::cout << out << std::flush; + } + std::cout << std::endl; } } } |