src/GamIO/ML5Hdr.cc
// ____________________________________________________________________________
// E                  MATLAB MAT 5 Header ASCII Output Functions
// ____________________________________________________________________________
E                  MATLAB MAT 5 Header ASCII Output Functions
E MATLAB MAT 5 Header ASCII Output Functions
void MatLab5Hdr::print(ostream& ostr, int hpf) const
  {
  if(hpf) ostr << "\n\t\tHeader";	
  ostr << "\n\t\t  Text:         ";	
  for(int i=0, nz=0, no=0; i<123; i++)	
    {					
    if(TextField[i] == ',')		
      {
      ostr << "\n\t\t               ";
      no = 0;
      }
    else if(TextField[i] == ' ')	
      nz++; 
    else
      {
      ostr << string(nz, ' ');
      ostr << TextField[i];
      no += nz + 1;			
      if(no > 55)
        {
        ostr << "\n\t\t               ";
        no = 0;
        }
      nz = 0;
      }
    }
short V = 0x0100;
if(Ver == V)
  ostr << "\n\t\t  Version:      " << 1;	
else
  ostr << "\n\t\t  Version:      " << Ver;	
  ostr << "\n\t\t  Endian:       " << M		
       << " " << I;
  if(M == 'I' && I == 'M') 
       ostr << " (stored little endian)";
  else ostr << " (stored big endian)";
  }
void MatLab5Hdr :: print ( ostream & ostr , int hpf ) const { if ( hpf ) ostr << " \n \t \t " ; ostr << " \n \t \t " ; for ( int i = 0 , nz = 0 , no = 0 ; i < 123 ; i ++ ) { if ( TextField [ i ] == ' ' ) { ostr << " \n \t \t " ; no = 0 ; } else if ( TextField [ i ] == ' ' ) nz ++ ; else { ostr << string ( nz , ' ' ) ; ostr << TextField [ i ] ; no += nz + 1 ; if ( no > 55 ) { ostr << " \n \t \t " ; no = 0 ; } nz = 0 ; } } short V = 0x0100 ; if ( Ver == V ) ostr << " \n \t \t " << 1 ; else ostr << " \n \t \t " << Ver ; ostr << " \n \t \t " << M << " " << I ; if ( M == ' ' && I == ' ' ) ostr << " " ; else ostr << " " ; }
____________________________________________________________________________
E                  MATLAB MAT 5 Header ASCII Output Functions
____________________________________________________________________________
____________________________________________________________________________ E MATLAB MAT 5 Header ASCII Output Functions ____________________________________________________________________________
// Input 		ML5H    : MAT version 5 header (this) // 			ostr	: An output stream //			hpf	: Header print flag // Output		ostr	: Output stream with MATLAB MAT file //				  header version 5 info placed into it // Note				: This information exists only at the //				  beginning of the MAT file // Header Title // 124 byte text field // Output it, leaving last // one off (a zero) // A comma triggers new line // Skip zeros if needed // Total output so far // Version // Version // Endian Indicator