Logo Search packages:      
Sourcecode: apertium version File versions  Download package

double EndianDoubleUtil::read ( istream &  is ) [static]

Read procedure, C++ I/O version.

Parameters:
isthe stream to read from.
Returns:
the first element readed from the current position of the stream

Definition at line 45 of file endian_double_util.cc.

{
  double retval;
#ifdef WORDS_BIGENDIAN
  is.read((char *) &retval, sizeof(double));
#else
  char *s = reinterpret_cast<char *>(&retval);

  for(int i = sizeof(double)-1; i != -1; i--)
  {
    is.read(&(s[i]), sizeof(char));
  } 
#endif
  return retval;    
}

Generated by  Doxygen 1.6.0   Back to index