FACT++  1.0
string Converter::ToFormat ( const std::vector< std::string > &  fits)
static

Definition at line 1004 of file Converter.cc.

References str.

Referenced by GetSize(), and DataWriteFits::Open().

1005 {
1006  ostringstream str;
1007  for (vector<string>::const_iterator it=fits.begin(); it!=fits.end(); it++)
1008  {
1009  size_t id=0;
1010  int n;
1011 
1012  try
1013  {
1014  n = stoi(*it, &id);
1015  }
1016  catch (exception&)
1017  {
1018  n = 1;
1019  }
1020 
1021  if (n==0)
1022  continue;
1023 
1024  switch ((*it)[id])
1025  {
1026  case 'A':
1027  case 'L':
1028  case 'B': str << ";C:" << n; break;
1029  case 'J': str << ";I:" << n; break;
1030  case 'I': str << ";S:" << n; break;
1031  case 'K': str << ";X:" << n; break;
1032  case 'E': str << ";F:" << n; break;
1033  case 'D': str << ";D:" << n; break;
1034  default:
1035  throw runtime_error("ToFormat - id not known.");
1036  }
1037  }
1038 
1039  return str.str().substr(1);
1040 }
char str[80]
Definition: test_client.c:7

+ Here is the caller graph for this function: