src/GamIO/XWinSer.cc
/* These functions check the mode specified when opening a XWinSer MAT file.
   We do not allow all of the possible modes availble to C++ filestreams.  In
   particular, we do not allow users to append to an existing file (since this
   would be bad if the existing data was written with a different byte order).
   Additonally, there seems to be some discrepancy between compilers as to
   what modes are available to fstream, so we just stick to the basics.

	in  = 1 (0x01)	out       = 2  (0x02)	ate      = 4   (0x03)
	app = 8	(0x08)	trunc     = 16 (0x10)	nocreate = 32  (0x20)
			noreplace = 64 (0x40) 	binary   = 128 (0x80)
   
   Use of noreplace & nocreate maybe didn't make it to ANSI standard...      */
These functions check the mode specified when opening a XWinSer MAT file.
We do not allow all of the possible modes availble to C++ filestreams.  In
particular, we do not allow users to append to an existing file (since this
would be bad if the existing data was written with a different byte order).
Additonally, there seems to be some discrepancy between compilers as to
what modes are available to fstream, so we just stick to the basics.



Use of noreplace & nocreate maybe didn't make it to ANSI standard
These functions check the mode specified when opening a XWinSer MAT file . We do not allow all of the possible modes availble to C ++ filestreams . In particular we do not allow users to append to an existing file ( since this would be bad if the existing data was written with a different byte order ) . Additonally there seems to be some discrepancy between compilers as to what modes are available to fstream so we just stick to the basics . Use of noreplace & nocreate maybe didn ' t make it to ANSI standard
void XWinSer::CheckMode(int mode)
  {
  if(!(mode & std::ios::binary))
    {
    XWinSererror(20, 1);			
    XWinSerfatality(21);			
    }
  if((mode & std::ios::out) && (mode & std::ios::in))
    {
    XWinSererror(22, 1);			
    XWinSerfatality(23);			
    }
  if(mode & std::ios::ate)
    {
    XWinSererror(24, 1);			
    XWinSerfatality(25);			
    }
  if(mode & std::ios::app)
    {
    XWinSererror(26, 1);			
    XWinSerfatality(27);			
    }
  }
void XWinSer :: CheckMode ( int mode ) { if ( ! ( mode & std :: ios :: binary ) ) { XWinSererror ( 20 , 1 ) ; XWinSerfatality ( 21 ) ; } if ( ( mode & std :: ios :: out ) && ( mode & std :: ios :: in ) ) { XWinSererror ( 22 , 1 ) ; XWinSerfatality ( 23 ) ; } if ( mode & std :: ios :: ate ) { XWinSererror ( 24 , 1 ) ; XWinSerfatality ( 25 ) ; } if ( mode & std :: ios :: app ) { XWinSererror ( 26 , 1 ) ; XWinSerfatality ( 27 ) ; } }
These functions check the mode specified when opening a XWinSer MAT file.
These functions check the mode specified when opening a XWinSer MAT file .
// File can't be ASCII // File must be binary // File can't be input & output // Open file as either input or output // File can't open at end // Must be opened without std::ios::ate // File can't open in append mode // Must be opened with ios:app