899 char *charDest =
static_cast<char*
>(dest);
900 const char *charSrc =
static_cast<const char*
>(src);
903 for (Converter::FormatList::const_iterator
i=
fList.begin();
i!=
fList.end()-1;
i++)
916 const char type =
i->first.first->name()[0];
919 charSrc += strlen(charSrc)+1;
923 const int s =
i->first.second;
924 const int n =
i->second.first;
928 throw runtime_error(
string(
"Type '")+type+
"' not supported converting to FITS.");
933 case 1: memcpy(charDest, charSrc, s*n); charSrc+=s*n; charDest+=s*n;
break;
934 case 2:
for (
int j=0; j<n; j++) { reverse_copy(charSrc, charSrc+2, charDest); charSrc+=2; charDest+=2; }
break;
935 case 4:
for (
int j=0; j<n; j++) { reverse_copy(charSrc, charSrc+4, charDest); charSrc+=4; charDest+=4; }
break;
936 case 8:
for (
int j=0; j<n; j++) { reverse_copy(charSrc, charSrc+8, charDest); charSrc+=8; charDest+=8; }
break;
940 if (charDest-
size!=dest)
943 err <<
"ToFits - Data block size (" <<
size <<
") doesn't fit format description [fmt=" <<
fFormat <<
"|size=" <<
GetSize() <<
"]";
944 throw runtime_error(err.str());
const FormatList fList
Original format string.
const std::string fFormat
ostream to which output is redirected