Ignore:
Timestamp:
07/12/07 11:57:05 (17 years ago)
Author:
mar637
Message:

export WCS info to ASCII file, this required returng const& of STSubTables. This partly addresses Ticket #110

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STFrequencies.cpp

    r1360 r1375  
    274274}
    275275
    276 std::string STFrequencies::print( int id )
     276std::string STFrequencies::print( int id, Bool strip ) const
    277277{
    278278  Table t;
     
    284284    const TableRecord& rec = row.get(i);
    285285    oss <<  setw(8)
    286     << t.keywordSet().asString("FRAME") << setw(16) << setprecision(8)
    287     << rec.asDouble("REFVAL") << setw(7)
    288     << rec.asDouble("REFPIX") << setw(12)
    289     << rec.asDouble("INCREMENT") << endl;
    290   }
    291   return String(oss);
     286        << t.keywordSet().asString("FRAME") << setw(16) << setprecision(8)
     287        << rec.asDouble("REFVAL") << setw(7)
     288        << rec.asDouble("REFPIX")
     289        << setw(12)
     290        << rec.asDouble("INCREMENT");
     291  }
     292  String outstr(oss);
     293  if (strip) {
     294    int f = outstr.find_first_not_of(' ');
     295    int l = outstr.find_last_not_of(' ', outstr.size());
     296    if (f < 0) {
     297      f = 0;
     298    }
     299    if ( l < f  || l < f ) {
     300      l = outstr.size();
     301    }
     302    return outstr.substr(f,l);
     303  }
     304  return outstr;
    292305}
    293306
Note: See TracChangeset for help on using the changeset viewer.