Changeset 17392 for trunk/Mars/mcore
- Timestamp:
- 11/26/13 19:14:53 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/fits.h
r17382 r17392 485 485 protected: 486 486 std::ofstream fCopy; 487 std::vector<std::string> fListOfTables; // List of skipped tables. Last table is open table 487 488 488 489 Table fTable; … … 558 559 } 559 560 560 void Constructor(const std::string &fname, std::string fout , const std::string& tableName, bool force, int tableNumber=-1)561 void Constructor(const std::string &fname, std::string fout="", const std::string& tableName="", bool force=false) 561 562 { 562 563 char simple[10]; … … 564 565 if (!good()) 565 566 return; 566 567 int current_table = 0;568 567 569 568 if (memcmp(simple, "SIMPLE = ", 10)) … … 642 641 } 643 642 643 const std::string &tname = fTable.Get<std::string>("EXTNAME"); 644 645 fListOfTables.emplace_back(tname); 646 644 647 // Check for table name. Skip until eof or requested table are found. 645 648 // skip the current table? 646 if ((!tableName.empty() && tableName!=fTable.Get<std::string>("EXTNAME")) || 647 ( tableName.empty() && "ZDrsCellOffsets"==fTable.Get<std::string>("EXTNAME")) || 648 (tableNumber != -1)) 649 if ((!tableName.empty() && tableName!=tname) || (tableName.empty() && "ZDrsCellOffsets"==tname)) 649 650 { 650 if (current_table == tableNumber)651 {652 fBufferRow.resize(fTable.bytes_per_row + 8-fTable.bytes_per_row%4);653 fBufferDat.resize(fTable.bytes_per_row);654 655 break;656 }657 651 const streamoff skip = fTable.GetTotalBytes(); 658 652 seekg(skip, std::ios_base::cur); 659 653 660 654 fChkHeader.reset(); 661 current_table++;662 655 663 656 continue; … … 688 681 #else 689 682 gLog << ___err___ << "ERROR - Failed to open output file." << std::endl; 683 return; 690 684 #endif 691 685 } … … 1043 1037 return fTable.Get<size_t>("NAXIS1"); 1044 1038 } 1039 1040 const std::vector<std::string> &GetTables() const 1041 { 1042 return fListOfTables; 1043 } 1045 1044 }; 1046 1045
Note:
See TracChangeset
for help on using the changeset viewer.