FACT++  1.0
template<class T >
T Converter::Get ( std::stringstream &  line) const
private

Compiled format description.

Converts from the stringstream into the provided type.

Parameters
linereference to the stringstream from which the data should be interpreted
Template Parameters
Typeof the data to be returned
Returns
The interpreted data

Definition at line 212 of file Converter.cc.

213 {
214  char c;
215  line >> c;
216  if (!line)
217  return T();
218 
219  if (c=='0')
220  {
221  if (line.peek()==-1)
222  {
223  line.clear(ios::eofbit);
224  return 0;
225  }
226 
227  if (line.peek()=='x')
228  {
229  line >> c;
230  line >> hex;
231  }
232  else
233  {
234  line.unget();
235  line >> oct;
236  }
237  }
238  else
239  {
240  line.unget();
241  line >> dec;
242  }
243 
244 
245  T val;
246  line >> val;
247  return val;
248 }