#include <i_uims_impl.h>


Definition at line 29 of file i_uims_impl.h.
Public Member Functions | |
| i_UIMessageServer_i (bool quietMode, bool a_detail) | |
| void | DisplayResult (const i_UIResult_t &a_res) |
| void | DisplayError (const char *a_error) |
| void | DisplayWarning (const char *a_error) |
| void | DisplayMessage (const char *a_message) |
| void | PrintHeader () |
| void | NoPrintHeader () |
| void | SetDetail () |
| void | Remove () |
| void | DisplayDetail (const i_UIResult_t &a_res) |
| void | DisplayTable (const i_UIResult_t &a_res) |
Protected Member Functions | |
| virtual | ~i_UIMessageServer_i () |
Private Attributes | |
| bool | m_quietMode |
| bool | m_printHeader |
| bool | m_detail |
| log_CLASSID_m | |
| i_UIMessageServer_i::i_UIMessageServer_i | ( | bool | quietMode, | |
| bool | a_detail | |||
| ) |
Definition at line 42 of file i_uims_impl.cpp.
References log_FUNC_m.
00042 : 00043 m_quietMode(a_quietMode), 00044 m_printHeader(true), 00045 m_detail(a_detail) { 00046 00047 log_FUNC_m(i_UIMessageServer_i); 00048 } // i_UIMessageServer_i::i_UIMessageServer_i
| i_UIMessageServer_i::~i_UIMessageServer_i | ( | ) | [protected, virtual] |
Definition at line 54 of file i_uims_impl.cpp.
References ipc_Corba::Shutdown().
00054 { 00055 00056 //log_FUNC_m(~i_UIMessageServer_i) - causes assertion failure on windows 00057 00058 ipc_Corba::Shutdown(); 00059 00060 } // i_UIMessageServer_i::~i_UIMessageServer_i

| void i_UIMessageServer_i::DisplayResult | ( | const i_UIResult_t & | a_res | ) |
Definition at line 62 of file i_uims_impl.cpp.
References DisplayDetail(), DisplayTable(), ipc_CATCH_IVD_THROW_CORBA_m, log_FUNC_m, and m_detail.
00062 { 00063 log_FUNC_m(DisplayResult); 00064 try { 00065 00066 if (m_detail) { 00067 DisplayDetail(a_res); 00068 } 00069 else { 00070 DisplayTable(a_res); 00071 } 00072 } ipc_CATCH_IVD_THROW_CORBA_m 00073 }

| void i_UIMessageServer_i::DisplayError | ( | const char * | a_error | ) |
| void i_UIMessageServer_i::DisplayWarning | ( | const char * | a_error | ) |
| void i_UIMessageServer_i::DisplayMessage | ( | const char * | a_message | ) |
| void i_UIMessageServer_i::PrintHeader | ( | ) | [inline] |
| void i_UIMessageServer_i::NoPrintHeader | ( | ) | [inline] |
| void i_UIMessageServer_i::SetDetail | ( | ) | [inline] |
| void i_UIMessageServer_i::Remove | ( | ) | [virtual] |
Reimplemented from i_Component_i.
Definition at line 1047 of file i_uims_impl.cpp.
References i_Component_i::Remove().
01047 { 01048 //log_FUNC_m(Remove); - causes assertion failure on windows 01049 i_Component_i::Remove(); 01050 }

| void i_UIMessageServer_i::DisplayDetail | ( | const i_UIResult_t & | a_res | ) |
Definition at line 76 of file i_uims_impl.cpp.
References i_UIResultCell_t::alignment, i_UIResultCell_t::boolVar, cmn_Num2Str(), dbg_DETAIL, dbg_LOW, dbg_NORM, ie_FATAL_ERROR, ie_NYI, ivd_DriveStatusToText(), ivd_FSTypeToText(), ivd_JobStatusToText(), ivd_JobTypeToText(), ivd_LibraryStatusToText(), ivd_LibraryTypeToText(), ivd_MediaFamilyToText(), ivd_MediaTypeToText(), ivd_MediaVolStatusToText(), ivd_MediumStatusToText(), ivd_NotApplicableToText(), ivd_PartitionActivityToText(), ivd_PartitionStatusToText(), ivd_PoolTypeToText(), ivd_SlotStatusToText(), ivd_SlotTypeToText(), ivd_SysVolLocationToText(), ivd_VolTypeToText(), len, log_DBG_m, log_FUNC_m, i_UIResultCell_t::num, i_UIResult_t::table, i_UIResultCell_t::text, i_UIResultCell_t::type, uialign_RIGHT, uires_BOOL, uires_DRIVESTATUS, uires_FSTYPE, uires_JOBSTATUS, uires_JOBTYPE, uires_LIBRARYSTATUS, uires_LIBRARYTYPE, uires_MEDIAFAMILYTYPE, uires_MEDIAPOOLTYPE, uires_MEDIATYPE, uires_MEDIUMSTATUS, uires_NA, uires_NUM, uires_PARTITIONACTIVITY, uires_PARTITIONSTATUS, uires_RAW, uires_SLOTSTATUS, uires_SLOTTYPE, uires_SYSVOLLOCATION, uires_TEXT, uires_VOLTYPE, uires_VOLUMESTATUS, and UTF8_TO_CONSOLE.
Referenced by DisplayResult().
00076 { 00077 log_FUNC_m(DisplayDetail); 00078 00079 stringstream strs; 00080 strs << setfill(' '); 00081 00082 UInt32_t header(0); 00083 UInt32_t maxLength(0); 00084 log_DBG_m(dbg_NORM, " j max:" << a_res.table.length()); 00085 for (UInt32_t j = 0; j < a_res.table.length(); j++) { 00086 log_DBG_m(dbg_NORM, " j:" << j << " kmax: " << a_res.table[j].row.length()); 00087 if ( a_res.table[j].isHdr) { 00088 header = j; 00089 for (UInt32_t k = 0; k < a_res.table[j].row.length(); k++) { 00090 00091 switch (a_res.table[j].row[k].type ) { 00092 case(uires_TEXT): 00093 { 00094 UInt32_t len(strlen(a_res.table[j].row[k].text)); 00095 if (maxLength < len) { 00096 maxLength = len; 00097 } 00098 } 00099 break; 00100 case(uires_NUM): 00101 { 00102 UInt32_t len(cmn_Num2Str((UInt64_t)a_res.table[j].row[k].num).size()); 00103 00104 if (maxLength < len) { 00105 maxLength = len; 00106 } 00107 } 00108 break; 00109 case(uires_LIBRARYSTATUS): 00110 { 00111 UInt32_t len(ivd_LibraryStatusToText(ivd_LibraryStatus_e(a_res.table[j].row[k].num)).size()); 00112 if (maxLength < len) { 00113 maxLength = len; 00114 } 00115 } 00116 break; 00117 case(uires_SLOTSTATUS): 00118 { 00119 UInt32_t len(ivd_SlotStatusToText(ivd_SlotStatus_e(a_res.table[j].row[k].num)).size()); 00120 if (maxLength < len) { 00121 maxLength = len; 00122 } 00123 } 00124 break; 00125 case(uires_DRIVESTATUS): 00126 { 00127 UInt32_t len(ivd_DriveStatusToText(ivd_DriveStatus_e(a_res.table[j].row[k].num)).size()); 00128 if (maxLength < len) { 00129 maxLength = len; 00130 } 00131 } 00132 break; 00133 case(uires_MEDIUMSTATUS): 00134 { 00135 UInt32_t len(ivd_MediumStatusToText(ivd_MediumStatus_e(a_res.table[j].row[k].num)).size()); 00136 if (maxLength < len) { 00137 maxLength = len; 00138 } 00139 } 00140 break; 00141 case(uires_VOLUMESTATUS): 00142 { 00143 UInt32_t len(ivd_MediaVolStatusToText(ivd_MediaVolStatus_e(a_res.table[j].row[k].num)).size()); 00144 if (maxLength < len) { 00145 maxLength = len; 00146 } 00147 } 00148 break; 00149 00150 case(uires_PARTITIONSTATUS): 00151 { 00152 UInt32_t len(ivd_PartitionStatusToText(ivd_PartitionStatus_e(a_res.table[j].row[k].num)).size()); 00153 if (maxLength < len) { 00154 maxLength = len; 00155 } 00156 } 00157 break; 00158 case(uires_PARTITIONACTIVITY): 00159 { 00160 UInt32_t len(ivd_PartitionActivityToText(ivd_PartitionActivity_e(a_res.table[j].row[k].num)).size()); 00161 if (maxLength < len) { 00162 maxLength = len; 00163 } 00164 } 00165 break; 00166 case(uires_JOBSTATUS): 00167 { 00168 UInt32_t len(ivd_JobStatusToText(ivd_JobStatus_e(a_res.table[j].row[k].num)).size()); 00169 00170 if (maxLength < len) { 00171 maxLength = len; 00172 } 00173 } 00174 break; 00175 case(uires_LIBRARYTYPE): 00176 { 00177 UInt32_t len(strlen(ivd_LibraryTypeToText(ivd_LibraryType_e(a_res.table[j].row[k].num)))); 00178 if (maxLength < len) { 00179 maxLength = len; 00180 } 00181 } 00182 break; 00183 case(uires_MEDIAFAMILYTYPE): 00184 { 00185 UInt32_t len(strlen(ivd_MediaFamilyToText(ivd_MediaFamily_e(a_res.table[j].row[k].num)))); 00186 if (maxLength < len) { 00187 maxLength = len; 00188 } 00189 } 00190 break; 00191 case(uires_MEDIAPOOLTYPE): 00192 { 00193 UInt32_t len(strlen(ivd_PoolTypeToText(ivd_PoolType_e(a_res.table[j].row[k].num)))); 00194 if (maxLength < len) { 00195 maxLength = len; 00196 } 00197 } 00198 break; 00199 case(uires_SLOTTYPE): 00200 { 00201 UInt32_t len(strlen(ivd_SlotTypeToText(ivd_SlotType_e(a_res.table[j].row[k].num)))); 00202 if (maxLength < len) { 00203 maxLength = len; 00204 } 00205 } 00206 break; 00207 case(uires_MEDIATYPE): 00208 { 00209 UInt32_t len(strlen(ivd_MediaTypeToText(ivd_MediaType_e(a_res.table[j].row[k].num)))); 00210 if (maxLength < len) { 00211 maxLength = len; 00212 } 00213 } 00214 break; 00215 00216 case(uires_SYSVOLLOCATION): 00217 { 00218 UInt32_t len(strlen(ivd_SysVolLocationToText(ivd_SysVolLocation_e(a_res.table[j].row[k].num)))); 00219 if (maxLength < len) { 00220 maxLength = len; 00221 } 00222 } 00223 break; 00224 00225 case(uires_VOLTYPE): 00226 { 00227 UInt32_t len(strlen(ivd_VolTypeToText(ivd_VolType_e(a_res.table[j].row[k].num)))); 00228 if (maxLength < len) { 00229 maxLength = len; 00230 } 00231 } 00232 break; 00233 00234 case(uires_NA): 00235 { 00236 UInt32_t len(strlen(ivd_NotApplicableToText())); 00237 if (maxLength < len) { 00238 maxLength = len; 00239 } 00240 } 00241 break; 00242 case(uires_FSTYPE): 00243 { 00244 UInt32_t len(strlen(ivd_FSTypeToText(ivd_FSType_e(a_res.table[j].row[k].num)))); 00245 if (maxLength < len) { 00246 maxLength = len; 00247 } 00248 } 00249 break; 00250 case(uires_JOBTYPE): 00251 { 00252 UInt32_t len(ivd_JobTypeToText(ivd_JobType_e(a_res.table[j].row[k].num)).size()); 00253 if (maxLength < len) { 00254 maxLength = len; 00255 } 00256 } 00257 break; 00258 default: 00259 log_DBG_m(dbg_LOW,"Wanted to check unknown type: " << a_res.table[j].row[k].type ); 00260 } // switch (a_res.table[j].row[k].type ) 00261 } // for (UInt32_t k = 0; k < a_res.table[j].row.length(); k++) 00262 } // if ( a_res.table[j].isHdr) 00263 else { 00264 00265 for (UInt32_t k = 0; k < a_res.table[j].row.length(); k++) { 00266 log_DBG_m(dbg_NORM, "maxLength: " << maxLength << " j:" << j << 00267 " k:" << k); 00268 if ( k >= a_res.table[header].row.length()) { 00269 throw ivd_InternalError(ie_FATAL_ERROR, 00270 "BUG: No header defined for field."); 00271 } 00272 00273 const i_UIResultCell_t& head = a_res.table[header].row[k]; 00274 ostringstream tmp; 00275 strs << setw(maxLength + 2) << left; 00276 switch (head.type) { 00277 case(uires_TEXT): 00278 // TODO: I18N - all text UTF8 -> OEM codepage for Windows 00279 tmp << UTF8_TO_CONSOLE(head.text) << ": "; 00280 strs << tmp.str(); 00281 break; 00282 case(uires_NUM): 00283 tmp << head.num << ": "; 00284 strs << tmp.str(); 00285 break; 00286 case(uires_BOOL): 00287 00288 (head.boolVar) ? (tmp << "true ") : (tmp << "false " )<< ": "; 00289 strs << tmp.str(); 00290 break; 00291 case(uires_RAW): 00292 //strs << string(head.raw); 00293 throw ivd_InternalError(ie_NYI); 00294 break; 00295 default: 00296 throw ivd_InternalError(ie_NYI); 00297 } 00298 00299 const i_UIResultCell_t& cell = a_res.table[j].row[k]; 00300 00301 switch (cell.type) { 00302 case(uires_TEXT): 00303 // TODO: I18N - all text UTF8 -> OEM codepage for Windows 00304 if (cell.alignment == uialign_RIGHT) { 00305 ostringstream cellStr; 00306 cellStr << UTF8_TO_CONSOLE(cell.text); 00307 strs << cellStr.str(); 00308 } 00309 else { 00310 strs << UTF8_TO_CONSOLE(cell.text); 00311 } 00312 00313 break; 00314 case(uires_NUM): 00315 { 00316 ostringstream numStr; 00317 numStr << cell.num; 00318 strs << numStr.str(); 00319 break; 00320 } 00321 case(uires_BOOL): 00322 (cell.boolVar) 00323 ? (strs << "true ") 00324 : (strs << "false "); 00325 break; 00326 00327 case(uires_RAW): 00328 //strs << string(cell.raw); 00329 throw ivd_InternalError(ie_NYI); 00330 break; 00331 case(uires_LIBRARYSTATUS): 00332 { 00333 ostringstream cellStrA; 00334 cellStrA << UTF8_TO_CONSOLE(ivd_LibraryStatusToText(ivd_LibraryStatus_e(cell.num)).c_str()); 00335 if (cell.alignment == uialign_RIGHT) { 00336 strs << right << cellStrA.str(); 00337 } 00338 else{ 00339 strs << left << cellStrA.str(); 00340 } 00341 } 00342 break; 00343 case(uires_SLOTSTATUS): 00344 { 00345 ostringstream cellStr; 00346 cellStr << UTF8_TO_CONSOLE(ivd_SlotStatusToText((ivd_SlotStatus_e )cell.num).c_str()); 00347 if (cell.alignment == uialign_RIGHT) { 00348 strs << right << cellStr.str(); 00349 } 00350 else { 00351 strs << left << cellStr.str(); 00352 } 00353 } 00354 break; 00355 case(uires_DRIVESTATUS): 00356 { 00357 ostringstream cellStr ; 00358 cellStr << UTF8_TO_CONSOLE(ivd_DriveStatusToText((ivd_DriveStatus_e ) cell.num).c_str()); 00359 if (cell.alignment == uialign_RIGHT) { 00360 strs << right << cellStr.str(); 00361 } 00362 else { 00363 strs << left << cellStr.str(); 00364 } 00365 } 00366 break; 00367 case(uires_PARTITIONSTATUS): 00368 { 00369 ostringstream cellStr ; 00370 cellStr << UTF8_TO_CONSOLE(ivd_PartitionStatusToText(ivd_PartitionStatus_e(cell.num)).c_str()); 00371 if (cell.alignment == uialign_RIGHT) { 00372 strs << right << cellStr.str(); 00373 } 00374 else { 00375 strs << left << cellStr.str(); 00376 } 00377 } 00378 break; 00379 case(uires_PARTITIONACTIVITY): 00380 { 00381 ostringstream cellStr ; 00382 cellStr << UTF8_TO_CONSOLE(ivd_PartitionActivityToText(ivd_PartitionActivity_e(cell.num)).c_str()); 00383 if (cell.alignment == uialign_RIGHT) { 00384 strs << right << cellStr.str(); 00385 } 00386 else { 00387 strs << left << cellStr.str(); 00388 } 00389 } 00390 break; 00391 case(uires_MEDIUMSTATUS): 00392 { 00393 ostringstream cellStr ; 00394 cellStr << UTF8_TO_CONSOLE(ivd_MediumStatusToText(ivd_MediumStatus_e(cell.num)).c_str()); 00395 if (cell.alignment == uialign_RIGHT) { 00396 strs << right << cellStr.str(); 00397 } 00398 else { 00399 strs << left << cellStr.str(); 00400 } 00401 } 00402 break; 00403 case(uires_VOLUMESTATUS): 00404 { 00405 ostringstream cellStr ; 00406 cellStr << UTF8_TO_CONSOLE( 00407 ivd_MediaVolStatusToText( 00408 ivd_MediaVolStatus_e(cell.num)).c_str() 00409 ); 00410 if (cell.alignment == uialign_RIGHT) { 00411 strs << right << cellStr.str(); 00412 } 00413 else { 00414 strs << left << cellStr.str(); 00415 } 00416 } 00417 break; 00418 case(uires_JOBSTATUS): 00419 { 00420 ostringstream cellStr ; 00421 cellStr << UTF8_TO_CONSOLE(ivd_JobStatusToText(ivd_JobStatus_e(cell.num)).c_str()); 00422 if (cell.alignment == uialign_RIGHT) { 00423 strs << right << cellStr.str(); 00424 } 00425 else { 00426 strs << left << cellStr.str(); 00427 } 00428 } 00429 break; 00430 case(uires_LIBRARYTYPE): 00431 { 00432 ostringstream cellStr ; 00433 cellStr << UTF8_TO_CONSOLE(ivd_LibraryTypeToText(ivd_LibraryType_e(cell.num))); 00434 if (cell.alignment == uialign_RIGHT) { 00435 strs << right << cellStr.str(); 00436 } 00437 else { 00438 strs << left << cellStr.str(); 00439 } 00440 } 00441 break; 00442 case(uires_MEDIAFAMILYTYPE): 00443 { 00444 ostringstream cellStr ; 00445 cellStr << UTF8_TO_CONSOLE(ivd_MediaFamilyToText(ivd_MediaFamily_e(cell.num))); 00446 if (cell.alignment == uialign_RIGHT) { 00447 strs << right << cellStr.str(); 00448 } 00449 else { 00450 strs << left << cellStr.str(); 00451 } 00452 } 00453 break; 00454 case(uires_MEDIAPOOLTYPE): 00455 { 00456 ostringstream cellStr ; 00457 cellStr << UTF8_TO_CONSOLE(ivd_PoolTypeToText(ivd_PoolType_e(cell.num))); 00458 if (cell.alignment == uialign_RIGHT) { 00459 strs << right << cellStr.str(); 00460 } 00461 else { 00462 strs << left << cellStr.str(); 00463 } 00464 } 00465 break; 00466 case(uires_SLOTTYPE): 00467 { 00468 ostringstream cellStr ; 00469 cellStr << UTF8_TO_CONSOLE(ivd_SlotTypeToText(ivd_SlotType_e(cell.num))); 00470 if (cell.alignment == uialign_RIGHT) { 00471 strs << right << cellStr.str(); 00472 } 00473 else { 00474 strs << left << cellStr.str(); 00475 } 00476 } 00477 break; 00478 case(uires_MEDIATYPE): 00479 { 00480 ostringstream cellStr ; 00481 cellStr << UTF8_TO_CONSOLE(ivd_MediaTypeToText(ivd_MediaType_e(cell.num))); 00482 if (cell.alignment == uialign_RIGHT) { 00483 strs << right << cellStr.str(); 00484 } 00485 else { 00486 strs << left << cellStr.str(); 00487 } 00488 } 00489 break; 00490 case(uires_SYSVOLLOCATION): 00491 { 00492 ostringstream cellStr ; 00493 cellStr << UTF8_TO_CONSOLE(ivd_SysVolLocationToText(ivd_SysVolLocation_e(cell.num))); 00494 if (cell.alignment == uialign_RIGHT) { 00495 strs << right << cellStr.str(); 00496 } 00497 else { 00498 strs << left << cellStr.str(); 00499 } 00500 } 00501 break; 00502 case(uires_VOLTYPE): 00503 { 00504 ostringstream cellStr ; 00505 log_DBG_m(dbg_NORM, " uires_VOLTYPE VolType: " << cell.num ); 00506 cellStr << UTF8_TO_CONSOLE(ivd_VolTypeToText(ivd_VolType_e(cell.num))); 00507 if (cell.alignment == uialign_RIGHT) { 00508 strs << right << cellStr.str(); 00509 } 00510 else { 00511 strs << left << cellStr.str(); 00512 } 00513 } 00514 break; 00515 case(uires_NA): 00516 { 00517 ostringstream cellStr ; 00518 cellStr << UTF8_TO_CONSOLE(ivd_NotApplicableToText()); 00519 if (cell.alignment == uialign_RIGHT) { 00520 strs << right << cellStr.str(); 00521 } 00522 else { 00523 strs << left << cellStr.str(); 00524 } 00525 } 00526 break; 00527 case(uires_FSTYPE): 00528 { 00529 ostringstream cellStr ; 00530 cellStr << UTF8_TO_CONSOLE(ivd_FSTypeToText(ivd_FSType_e(cell.num))); 00531 if (cell.alignment == uialign_RIGHT) { 00532 strs << right << cellStr.str(); 00533 } 00534 else { 00535 strs << left << cellStr.str(); 00536 } 00537 } 00538 break; 00539 00540 case(uires_JOBTYPE): 00541 { 00542 ostringstream cellStr ; 00543 cellStr << UTF8_TO_CONSOLE(ivd_JobTypeToText(ivd_JobType_e(cell.num)).c_str()); 00544 if (cell.alignment == uialign_RIGHT) { 00545 strs << right << cellStr.str(); 00546 } 00547 else { 00548 strs << left << cellStr.str(); 00549 } 00550 } 00551 break; 00552 00553 00554 00555 default: 00556 throw ivd_InternalError(ie_NYI); 00557 00558 } // switch (cell.type) 00559 strs << endl; 00560 log_DBG_m(dbg_DETAIL, "str: " << strs.str()); 00561 } // for (UInt32_t k = 0; k < a_res.table[j].row.length(); k++) 00562 strs << endl; 00563 } // else 00564 } // for (UInt32_t j = 0; j < a_res.table.length(); j++) 00565 cout << strs.str(); 00566 00567 }


| void i_UIMessageServer_i::DisplayTable | ( | const i_UIResult_t & | a_res | ) |
Definition at line 569 of file i_uims_impl.cpp.
References i_UIResultCell_t::alignment, i_UIResultCell_t::boolVar, cmn_Num2Str(), dbg_DETAIL, dbg_LOW, dbg_NORM, ivd_DriveStatusToText(), ivd_FSTypeToText(), ivd_JobStatusToText(), ivd_JobTypeToText(), ivd_LibraryStatusToText(), ivd_LibraryTypeToText(), ivd_MediaFamilyToText(), ivd_MediaTypeToText(), ivd_MediaVolStatusToText(), ivd_MediumStatusToText(), ivd_NotApplicableToText(), ivd_PartitionActivityToText(), ivd_PartitionStatusToText(), ivd_PoolTypeToText(), ivd_SlotStatusToText(), ivd_SlotTypeToText(), ivd_SysVolLocationToText(), ivd_VolTypeToText(), len, log_DBG_m, log_FUNC_m, m_printHeader, i_UIResultCell_t::num, i_UIResult_t::table, i_UIResultCell_t::text, i_UIResultCell_t::type, uialign_RIGHT, uires_BOOL, uires_DRIVESTATUS, uires_FSTYPE, uires_JOBSTATUS, uires_JOBTYPE, uires_LIBRARYSTATUS, uires_LIBRARYTYPE, uires_MEDIAFAMILYTYPE, uires_MEDIAPOOLTYPE, uires_MEDIATYPE, uires_MEDIUMSTATUS, uires_NA, uires_NUM, uires_PARTITIONACTIVITY, uires_PARTITIONSTATUS, uires_RAW, uires_SLOTSTATUS, uires_SLOTTYPE, uires_SYSVOLLOCATION, uires_TEXT, uires_VOLTYPE, uires_VOLUMESTATUS, and UTF8_TO_CONSOLE.
Referenced by DisplayResult().
00569 { 00570 log_FUNC_m(DisplayTable); 00571 stringstream strs; 00572 00573 //for each row find max value 00574 vector<UInt32_t> maxLength; 00575 00576 for (UInt32_t j = 0; j < a_res.table.length(); j++) { 00577 00578 for (UInt32_t k = 0; k < a_res.table[j].row.length(); k++) { 00579 00580 if ( maxLength.size() < a_res.table[j].row.length() ) { 00581 log_DBG_m(dbg_DETAIL,"resizing"); 00582 maxLength.resize(a_res.table[j].row.length()); 00583 } 00584 00585 switch (a_res.table[j].row[k].type ) { 00586 case(uires_TEXT): 00587 { 00588 UInt32_t len(strlen(a_res.table[j].row[k].text)); 00589 if (maxLength[k] < len) { 00590 maxLength[k] = len; 00591 } 00592 } 00593 break; 00594 case(uires_NUM): 00595 { 00596 UInt32_t len((cmn_Num2Str((UInt64_t)a_res.table[j].row[k].num).size())); 00597 if (maxLength[k] < len) { 00598 maxLength[k] = len; 00599 } 00600 } 00601 break; 00602 case(uires_LIBRARYSTATUS): 00603 { 00604 UInt32_t len(ivd_LibraryStatusToText(ivd_LibraryStatus_e(a_res.table[j].row[k].num)).size()); 00605 if (maxLength[k] < len) { 00606 maxLength[k] = len; 00607 } 00608 } 00609 break; 00610 case(uires_SLOTSTATUS): 00611 { 00612 UInt32_t len(ivd_SlotStatusToText(ivd_SlotStatus_e(a_res.table[j].row[k].num)).size()); 00613 if (maxLength[k] < len) { 00614 maxLength[k] = len; 00615 } 00616 } 00617 break; 00618 case(uires_DRIVESTATUS): 00619 { 00620 UInt32_t len(ivd_DriveStatusToText(ivd_DriveStatus_e(a_res.table[j].row[k].num)).size()); 00621 if (maxLength[k] < len) { 00622 maxLength[k] = len; 00623 } 00624 } 00625 break; 00626 case(uires_MEDIUMSTATUS): 00627 { 00628 UInt32_t len(ivd_MediumStatusToText(ivd_MediumStatus_e(a_res.table[j].row[k].num)).size()); 00629 if (maxLength[k] < len) { 00630 maxLength[k] = len; 00631 } 00632 } 00633 break; 00634 case(uires_VOLUMESTATUS): 00635 { 00636 UInt32_t len(ivd_MediaVolStatusToText(ivd_MediaVolStatus_e(a_res.table[j].row[k].num)).size()); 00637 if (maxLength[k] < len) { 00638 maxLength[k] = len; 00639 } 00640 } 00641 break; 00642 00643 case(uires_PARTITIONSTATUS): 00644 { 00645 UInt32_t len(ivd_PartitionStatusToText(ivd_PartitionStatus_e(a_res.table[j].row[k].num)).size()); 00646 if (maxLength[k] < len) { 00647 maxLength[k] = len; 00648 } 00649 } 00650 break; 00651 00652 case(uires_PARTITIONACTIVITY): 00653 { 00654 UInt32_t len(ivd_PartitionActivityToText(ivd_PartitionActivity_e(a_res.table[j].row[k].num)).size()); 00655 if (maxLength[k] < len) { 00656 maxLength[k] = len; 00657 } 00658 } 00659 break; 00660 00661 case(uires_JOBSTATUS): 00662 { 00663 UInt32_t len(ivd_JobStatusToText(ivd_JobStatus_e(a_res.table[j].row[k].num)).size()); 00664 if (maxLength[k] < len) { 00665 maxLength[k] = len; 00666 } 00667 } 00668 break; 00669 case(uires_LIBRARYTYPE): 00670 { 00671 UInt32_t len(strlen(ivd_LibraryTypeToText(ivd_LibraryType_e(a_res.table[j].row[k].num)))); 00672 if (maxLength[k] < len) { 00673 maxLength[k] = len; 00674 } 00675 } 00676 break; 00677 case(uires_MEDIAFAMILYTYPE): 00678 { 00679 UInt32_t len(strlen(ivd_MediaFamilyToText(ivd_MediaFamily_e(a_res.table[j].row[k].num)))); 00680 if (maxLength[k] < len) { 00681 maxLength[k] = len; 00682 } 00683 } 00684 break; 00685 case(uires_MEDIAPOOLTYPE): 00686 { 00687 UInt32_t len(strlen(ivd_PoolTypeToText(ivd_PoolType_e(a_res.table[j].row[k].num)))); 00688 if (maxLength[k] < len) { 00689 maxLength[k] = len; 00690 } 00691 } 00692 break; 00693 case(uires_SLOTTYPE): 00694 { 00695 UInt32_t len(strlen(ivd_SlotTypeToText(ivd_SlotType_e(a_res.table[j].row[k].num)))); 00696 if (maxLength[k] < len) { 00697 maxLength[k] = len; 00698 } 00699 } 00700 break; 00701 case(uires_MEDIATYPE): 00702 { 00703 UInt32_t len(strlen(ivd_MediaTypeToText(ivd_MediaType_e(a_res.table[j].row[k].num)))); 00704 if (maxLength[k] < len) { 00705 maxLength[k] = len; 00706 } 00707 } 00708 break; 00709 00710 case(uires_SYSVOLLOCATION): 00711 { 00712 UInt32_t len(strlen(ivd_SysVolLocationToText(ivd_SysVolLocation_e(a_res.table[j].row[k].num)))); 00713 if (maxLength[k] < len) { 00714 maxLength[k] = len; 00715 } 00716 } 00717 break; 00718 case(uires_VOLTYPE): 00719 { 00720 UInt32_t len(strlen(ivd_VolTypeToText(ivd_VolType_e(a_res.table[j].row[k].num)))); 00721 if (maxLength[k] < len) { 00722 maxLength[k] = len; 00723 } 00724 } 00725 break; 00726 00727 case(uires_NA): 00728 { 00729 UInt32_t len(strlen(ivd_NotApplicableToText())); 00730 if (maxLength[k] < len) { 00731 maxLength[k] = len; 00732 } 00733 } 00734 break; 00735 00736 case(uires_FSTYPE): 00737 { 00738 UInt32_t len(strlen(ivd_FSTypeToText(ivd_FSType_e(a_res.table[j].row[k].num)))); 00739 if (maxLength[k] < len) { 00740 maxLength[k] = len; 00741 } 00742 } 00743 break; 00744 00745 case(uires_JOBTYPE): 00746 { 00747 UInt32_t len(ivd_JobTypeToText(ivd_JobType_e(a_res.table[j].row[k].num)).size()); 00748 if (maxLength[k] < len) { 00749 maxLength[k] = len; 00750 } 00751 } 00752 break; 00753 00754 default: 00755 log_DBG_m(dbg_LOW,"Wanted to check unknown type: " << a_res.table[j].row[k].type ); 00756 00757 } // switch (a_res.table[j].row[k].type ) 00758 } // for (UInt32_t k = 0; k < a_res.table[j].row.length(); k++) 00759 } // for (UInt32_t j = 0; j < a_res.table.length(); j++) 00760 00761 for (UInt32_t j = 0; j < a_res.table.length(); j++) { 00762 if ( !a_res.table[j].isHdr || (a_res.table[j].isHdr && m_printHeader)) { 00763 //NoPrintHeader(); 00764 for (UInt32_t k = 0; k < a_res.table[j].row.length(); k++) { 00765 const i_UIResultCell_t& cell = a_res.table[j].row[k]; 00766 00767 strs << setw(maxLength[k] + 2); 00768 switch (cell.type) { 00769 case(uires_TEXT): 00770 // TODO: I18N - all text UTF8 -> OEM codepage for Windows 00771 if (cell.alignment == uialign_RIGHT) { 00772 ostringstream cellStr; 00773 cellStr << UTF8_TO_CONSOLE(cell.text) << " "; 00774 strs << right << cellStr.str(); 00775 } 00776 else { 00777 strs << left << UTF8_TO_CONSOLE(cell.text); 00778 } 00779 00780 break; 00781 case(uires_NUM): 00782 { 00783 ostringstream numStr; 00784 numStr << cell.num << " "; 00785 strs << right << numStr.str(); 00786 break; 00787 } 00788 case(uires_BOOL): 00789 strs << right; 00790 (cell.boolVar) 00791 ? (strs << "true ") 00792 : (strs << "false "); 00793 break; 00794 00795 case(uires_RAW): 00796 //strs << string(cell.raw); 00797 // Empty 00798 break; 00799 case(uires_LIBRARYSTATUS): 00800 { 00801 ostringstream cellStrA; 00802 cellStrA << UTF8_TO_CONSOLE(ivd_LibraryStatusToText((ivd_LibraryStatus_e ) cell.num).c_str()) << " "; 00803 if (cell.alignment == uialign_RIGHT) { 00804 strs << right << cellStrA.str(); 00805 } 00806 else { 00807 strs << left << cellStrA.str(); 00808 } 00809 } 00810 break; 00811 case(uires_SLOTSTATUS): 00812 { 00813 ostringstream cellStr; 00814 cellStr << UTF8_TO_CONSOLE(ivd_SlotStatusToText((ivd_SlotStatus_e ) cell.num).c_str()) << " "; 00815 if (cell.alignment == uialign_RIGHT) { 00816 strs << right << cellStr.str(); 00817 } 00818 else { 00819 strs << left << cellStr.str(); 00820 } 00821 } 00822 00823 break; 00824 case(uires_DRIVESTATUS): 00825 { 00826 ostringstream cellStr; 00827 cellStr << UTF8_TO_CONSOLE(ivd_DriveStatusToText((ivd_DriveStatus_e ) cell.num).c_str()) << " "; 00828 if (cell.alignment == uialign_RIGHT) { 00829 strs << right << cellStr.str(); 00830 } 00831 else { 00832 strs << left << cellStr.str(); 00833 } 00834 } 00835 break; 00836 case(uires_PARTITIONSTATUS): 00837 { 00838 ostringstream cellStr ; 00839 cellStr << UTF8_TO_CONSOLE(ivd_PartitionStatusToText((ivd_PartitionStatus_e ) cell.num).c_str()) << " "; 00840 if (cell.alignment == uialign_RIGHT) { 00841 strs << right << cellStr.str(); 00842 } 00843 else { 00844 strs << left << cellStr.str(); 00845 } 00846 } 00847 break; 00848 case(uires_PARTITIONACTIVITY): 00849 { 00850 ostringstream cellStr ; 00851 cellStr << UTF8_TO_CONSOLE(ivd_PartitionActivityToText((ivd_PartitionActivity_e ) cell.num).c_str()) << " "; 00852 if (cell.alignment == uialign_RIGHT) { 00853 strs << right << cellStr.str(); 00854 } 00855 else { 00856 strs << left << cellStr.str(); 00857 } 00858 } 00859 break; 00860 case(uires_MEDIUMSTATUS): 00861 { 00862 ostringstream cellStr ; 00863 cellStr << UTF8_TO_CONSOLE(ivd_MediumStatusToText((ivd_MediumStatus_e ) cell.num).c_str()) << " "; 00864 if (cell.alignment == uialign_RIGHT) { 00865 strs << right << cellStr.str(); 00866 } 00867 else { 00868 strs << left << cellStr.str(); 00869 } 00870 } 00871 00872 break; 00873 case(uires_VOLUMESTATUS): 00874 { 00875 ostringstream cellStr ; 00876 cellStr << UTF8_TO_CONSOLE(ivd_MediaVolStatusToText((ivd_MediaVolStatus_e ) cell.num).c_str()) << " "; 00877 if (cell.alignment == uialign_RIGHT) { 00878 strs << right << cellStr.str(); 00879 } 00880 else { 00881 strs << left << cellStr.str(); 00882 } 00883 } 00884 break; 00885 case(uires_JOBSTATUS): 00886 { 00887 ostringstream cellStr ; 00888 cellStr << UTF8_TO_CONSOLE(ivd_JobStatusToText((ivd_JobStatus_e ) cell.num).c_str()) << " "; 00889 if (cell.alignment == uialign_RIGHT) { 00890 strs << right << cellStr.str(); 00891 } 00892 else { 00893 strs << left << cellStr.str(); 00894 } 00895 } 00896 break; 00897 case(uires_LIBRARYTYPE): 00898 { 00899 ostringstream cellStr ; 00900 cellStr << UTF8_TO_CONSOLE(ivd_LibraryTypeToText(ivd_LibraryType_e(cell.num))) << " "; 00901 if (cell.alignment == uialign_RIGHT) { 00902 strs << right << cellStr.str(); 00903 } 00904 else { 00905 strs << left << cellStr.str(); 00906 } 00907 } 00908 break; 00909 case(uires_MEDIAFAMILYTYPE): 00910 { 00911 ostringstream cellStr ; 00912 cellStr << UTF8_TO_CONSOLE(ivd_MediaFamilyToText(ivd_MediaFamily_e(cell.num)))<< " "; 00913 if (cell.alignment == uialign_RIGHT) { 00914 strs << right << cellStr.str(); 00915 } 00916 else { 00917 strs << left << cellStr.str(); 00918 } 00919 } 00920 break; 00921 case(uires_MEDIAPOOLTYPE): 00922 { 00923 ostringstream cellStr ; 00924 cellStr << UTF8_TO_CONSOLE(ivd_PoolTypeToText(ivd_PoolType_e(cell.num))) << " "; 00925 if (cell.alignment == uialign_RIGHT) { 00926 strs << right << cellStr.str(); 00927 } 00928 else { 00929 strs << left << cellStr.str(); 00930 } 00931 } 00932 break; 00933 case(uires_SLOTTYPE): 00934 { 00935 ostringstream cellStr ; 00936 cellStr << UTF8_TO_CONSOLE(ivd_SlotTypeToText(ivd_SlotType_e(cell.num))) << " "; 00937 if (cell.alignment == uialign_RIGHT) { 00938 strs << right << cellStr.str(); 00939 } 00940 else { 00941 strs << left << cellStr.str(); 00942 } 00943 } 00944 break; 00945 case(uires_MEDIATYPE): 00946 { 00947 ostringstream cellStr ; 00948 cellStr << UTF8_TO_CONSOLE(ivd_MediaTypeToText(ivd_MediaType_e(cell.num))) << " "; 00949 if (cell.alignment == uialign_RIGHT) { 00950 strs << right << cellStr.str(); 00951 } 00952 else { 00953 strs << left << cellStr.str(); 00954 } 00955 } 00956 break; 00957 case(uires_SYSVOLLOCATION): 00958 { 00959 ostringstream cellStr ; 00960 cellStr << UTF8_TO_CONSOLE(ivd_SysVolLocationToText(ivd_SysVolLocation_e(cell.num)))<< " "; 00961 if (cell.alignment == uialign_RIGHT) { 00962 strs << right << cellStr.str(); 00963 } 00964 else { 00965 strs << left << cellStr.str(); 00966 } 00967 } 00968 break; 00969 case(uires_VOLTYPE): 00970 { 00971 ostringstream cellStr ; 00972 log_DBG_m(dbg_NORM, " uires_VOLTYPE VolType: " << cell.num ); 00973 cellStr << UTF8_TO_CONSOLE(ivd_VolTypeToText(ivd_VolType_e(cell.num))) << " "; 00974 if (cell.alignment == uialign_RIGHT) { 00975 strs << right << cellStr.str(); 00976 } 00977 else { 00978 strs << left << cellStr.str(); 00979 } 00980 } 00981 break; 00982 case(uires_NA): 00983 { 00984 ostringstream cellStr ; 00985 cellStr << UTF8_TO_CONSOLE(ivd_NotApplicableToText()) << " "; 00986 if (cell.alignment == uialign_RIGHT) { 00987 strs << right << cellStr.str(); 00988 } 00989 else { 00990 strs << left << cellStr.str(); 00991 } 00992 } 00993 break; 00994 00995 case(uires_FSTYPE): 00996 { 00997 ostringstream cellStr ; 00998 cellStr << UTF8_TO_CONSOLE(ivd_FSTypeToText(ivd_FSType_e(cell.num))) << " "; 00999 if (cell.alignment == uialign_RIGHT) { 01000 strs << right << cellStr.str(); 01001 } 01002 else { 01003 strs << left << cellStr.str(); 01004 } 01005 } 01006 break; 01007 case(uires_JOBTYPE): 01008 { 01009 ostringstream cellStr ; 01010 cellStr << UTF8_TO_CONSOLE(ivd_JobTypeToText(ivd_JobType_e(cell.num)).c_str()) << " "; 01011 if (cell.alignment == uialign_RIGHT) { 01012 strs << right << cellStr.str(); 01013 } 01014 else { 01015 strs << left << cellStr.str(); 01016 } 01017 } 01018 break; 01019 default: 01020 log_DBG_m(dbg_LOW,"Wanted to check unknown type: " << a_res.table[j].row[k].type ); 01021 } // switch (cell.type) 01022 01023 } // for (UInt32_t k = 0; k < a_res.table[j].row.length(); k++) 01024 01025 } // if ( !a_res.table[j].isHdr || (a_res.table[j].isHdr && m_printHeader)) 01026 strs << endl; 01027 } // for (UInt32_t j = 0; j < a_res.table.length(); j++) 01028 01029 cout << strs.str(); 01030 }


bool i_UIMessageServer_i::m_quietMode [private] |
Definition at line 67 of file i_uims_impl.h.
bool i_UIMessageServer_i::m_printHeader [private] |
bool i_UIMessageServer_i::m_detail [private] |
i_UIMessageServer_i::log_CLASSID_m [private] |
1.5.6