Changeset 2663 for box/RELEASE/0.11rc7/bin/bbackupquery/BackupQueries.cpp
- Timestamp:
- 08/03/2010 22:00:55 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
box/RELEASE/0.11rc7/bin/bbackupquery/BackupQueries.cpp
r2661 r2663 213 213 { "quit", "" }, 214 214 { "exit", "" }, 215 { "list", "rodIFtT sh", },215 { "list", "rodIFtTash", }, 216 216 { "pwd", "" }, 217 217 { "cd", "od" }, … … 398 398 #define LIST_OPTION_TIMES_LOCAL 't' 399 399 #define LIST_OPTION_TIMES_UTC 'T' 400 #define LIST_OPTION_TIMES_ATTRIBS 'a' 400 401 #define LIST_OPTION_SIZEINBLOCKS 's' 401 402 #define LIST_OPTION_DISPLAY_HASH 'h' … … 436 437 } 437 438 439 static std::string GetTimeString(BackupStoreDirectory::Entry& en, 440 bool useLocalTime, bool showAttrModificationTimes) 441 { 442 std::ostringstream out; 443 box_time_t originalTime, newAttributesTime; 444 445 // there is no attribute modification time in the directory 446 // entry, unfortunately, so we can't display it. 447 originalTime = en.GetModificationTime(); 448 out << BoxTimeToISO8601String(originalTime, useLocalTime); 449 450 if(en.HasAttributes()) 451 { 452 const StreamableMemBlock &storeAttr(en.GetAttributes()); 453 BackupClientFileAttributes attr(storeAttr); 454 455 box_time_t NewModificationTime, NewAttrModificationTime; 456 attr.GetModificationTimes(&NewModificationTime, 457 &NewAttrModificationTime); 458 459 if (showAttrModificationTimes) 460 { 461 newAttributesTime = NewAttrModificationTime; 462 } 463 else 464 { 465 newAttributesTime = NewModificationTime; 466 } 467 468 if (newAttributesTime == originalTime) 469 { 470 out << "*"; 471 } 472 else 473 { 474 out << "~" << BoxTimeToISO8601String(newAttributesTime, 475 useLocalTime); 476 } 477 } 478 else 479 { 480 out << " "; 481 } 482 483 return out.str(); 484 } 438 485 439 486 // -------------------------------------------------------------------------- … … 535 582 { 536 583 // Show UTC times... 537 std::string time = BoxTimeToISO8601String( 538 en->GetModificationTime(), false); 539 printf("%s ", time.c_str()); 584 printf("%s ", GetTimeString(*en, false, 585 opts[LIST_OPTION_TIMES_ATTRIBS]).c_str()); 540 586 } 541 587 … … 543 589 { 544 590 // Show local times... 545 std::string time = BoxTimeToISO8601String( 546 en->GetModificationTime(), true); 547 printf("%s ", time.c_str()); 591 printf("%s ", GetTimeString(*en, true, 592 opts[LIST_OPTION_TIMES_ATTRIBS]).c_str()); 548 593 } 549 594
Note: See TracChangeset
for help on using the changeset viewer.
