FACT++  1.0
vector< string > Converter::ToStrings ( const void *  src) const

Definition at line 948 of file Converter.cc.

References fList, i, str, and type.

Referenced by GetSize().

949 {
950  const char *charSrc = static_cast<const char*>(src);
951 
952  vector<string> rc;
953 
954  for (Converter::FormatList::const_iterator i=fList.begin(); i!=fList.end(); i++)
955  {
956  /*
957  if (charSrc-size>src)
958  {
959  ostringstream err;
960  err << "Format description [fmt=" << fFormat << "] exceeds available data size (" << size << ")";
961  throw runtime_error(err.str());
962  }*/
963 
964  const char type = i->first.first->name()[0];
965  if (type=='v')
966  break;
967 
968  if (type=='S' || type=='N')
969  {
970  const string str(charSrc);
971  rc.push_back(str);
972  charSrc += str.length()+1;
973  continue;
974  }
975 
976  // string types
977  //if (string("bsilfdxc").find_first_of(type)==string::npos)
978  // throw runtime_error(string("Type '")+type+"' not supported converting to FITS.");
979 
980  const int s = i->first.second; // size of element
981  const int n = i->second.first; // number of elements
982 
983  charSrc += s*n;
984  }
985 
986  return rc;
987 
988  /*
989  if (charSrc-size!=src)
990  {
991  ostringstream err;
992  err << "Data block size (" << size << ") doesn't fit format description [fmt=" << fFormat << "]";
993  throw runtime_error(err.str());
994  }*/
995 }
int i
Definition: db_dim_client.c:21
char str[80]
Definition: test_client.c:7
int type
const FormatList fList
Original format string.
Definition: Converter.h:33

+ Here is the caller graph for this function: