Changeset 11702 for trunk


Ignore:
Timestamp:
07/29/11 15:49:47 (13 years ago)
Author:
tbretz
Message:
Added GetSize() memember function and return this value in case of errors.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Converter.cc

    r11564 r11702  
    645645        {
    646646            ostringstream err;
    647             err << "Format description [fmt=" << fFormat << "] exceeds available data size (" << size << ")";
     647            err << "Format description [fmt=" << fFormat << "|size=" << GetSize() << "] exceeds available data size (" << size << ")";
    648648            throw runtime_error(err.str());
    649649        }
     
    685685    {
    686686        ostringstream err;
    687         err << "Data block size (" << size << ") doesn't fit format description [fmt=" << fFormat << "]";
     687        err << "Data block size (" << size << ") doesn't fit format description [fmt=" << fFormat << "|size=" << GetSize() <<"]";
    688688        throw runtime_error(err.str());
    689689    }
     
    916916   {
    917917       ostringstream err;
    918        err << "ToFits - Data block size (" << size << ") doesn't fit format description [fmt=" << fFormat << "]";
     918       err << "ToFits - Data block size (" << size << ") doesn't fit format description [fmt=" << fFormat << "|size=" << GetSize() << "]";
    919919       throw runtime_error(err.str());
    920920   }
  • trunk/FACT++/src/Converter.h

    r11564 r11702  
    8585
    8686    const FormatList &GetList() const { return fList; }
     87    size_t GetSize() const { return fList.size()==0 ? 0 : fList.back().second.second; }
    8788
    8889    static FormatList Compile(std::ostream &out, const std::string &fmt, bool strict=false);
Note: See TracChangeset for help on using the changeset viewer.