Changeset 11027 for trunk/FACT++/src


Ignore:
Timestamp:
06/15/11 11:01:24 (13 years ago)
Author:
tbretz
Message:
Allow support for chars; assume that the given size is the destination size
File:
1 edited

Legend:

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

    r11026 r11027  
    856856}
    857857
    858 
     858// --------------------------------------------------------------------------
     859//
     860//! @param dest
     861//!    Array to which the destination data is written
     862//! @param src
     863//!    Array with the source data according to the format stored in the
     864//!    Converter
     865//! @param size
     866//!    size of the destination data in bytes
     867//!
    859868void Converter::ToFits(void *dest, const void *src, size_t size) const
    860869{
     
    870879   for (Converter::FormatList::const_iterator i=fList.begin(); i!=fList.end(); i++)
    871880   {
    872        if (charDest-size>dest)
     881       if (charDest-size>dest/* || charSrc-size>src*/)
    873882       {
    874883           ostringstream err;
     
    883892       if (type=='S')
    884893       {
    885            size -= strlen(charSrc)+1;
    886894           charSrc += strlen(charSrc)+1;
     895           continue;
    887896
    888897           // copy string until termination
    889 //          while (*charSrc)
    890 //               *charDest++ = *charSrc++;
    891 //
    892 //          *charDest++ = *charSrc++;
     898           // while (*charSrc)
     899           //     *charDest++ = *charSrc++;
     900           //
     901           // *charDest++ = *charSrc++;
    893902       }
    894903
    895904       // string types
    896        if (string("bsilfdx").find_first_of(type)==string::npos)
     905       if (string("bsilfdxc").find_first_of(type)==string::npos)
    897906           throw runtime_error(string("Type '")+type+"' not supported converting to FITS.");
    898907
     
    910919   }
    911920
    912    if (charDest-size!=dest)
     921   if (charDest-size!=dest/* || charSrc-size!=src*/)
    913922   {
    914923       ostringstream err;
Note: See TracChangeset for help on using the changeset viewer.