src/GamIO/ML4DElem.cc
// ____________________________________________________________________________
// B                MATLAB MAT 4 Data Element Access Functions
// ____________________________________________________________________________
B                MATLAB MAT 4 Data Element Access Functions
B MATLAB MAT 4 Data Element Access Functions
void MatLab4DE::whos(std::ostream& ostr, std::fstream& fp)
  {
  if(!fp) return;			
  int pos = fp.tellp();			
  int TF = Tag.read(fp, 1);		
  TF *= ReadName(fp, 1);		
  ostr << "\n" << std::string(12, ' ');	
  int len = Name.length();		
  if(len > 10)				
    ostr << Name.substr(0,7) << "...";	
  else					
    ostr << Name << std::string(10-len, ' ');
  ostr << "  ";				
  std::string dimstr = Gdec(int(Tag.mrows))	
                + std::string(" x ")
                + Gdec(int(Tag.ncols));
  len = dimstr.length();		
  ostr << dimstr << std::string(10-len, ' ');
  int NB = 11111;			
  if(Tag.cmplxf) NB +=2;		
  std::string byt = Gdec(NB);			
  len = byt.length();			
  ostr << "  ";				
  ostr << byt << std::string(10-len, ' ');	
  ostr << "  ";				
  fp.seekp(pos);			
  }
void MatLab4DE :: whos ( std :: ostream & ostr , std :: fstream & fp ) { if ( ! fp ) return ; int pos = fp . tellp ( ) ; int TF = Tag . read ( fp , 1 ) ; TF *= ReadName ( fp , 1 ) ; ostr << " \n " << std :: string ( 12 , ' ' ) ; int len = Name . length ( ) ; if ( len > 10 ) ostr << Name . substr ( 0 , 7 ) << " " ; else ostr << Name << std :: string ( 10 - len , ' ' ) ; ostr << " " ; std :: string dimstr = Gdec ( int ( Tag . mrows ) ) + std :: string ( " " ) + Gdec ( int ( Tag . ncols ) ) ; len = dimstr . length ( ) ; ostr << dimstr << std :: string ( 10 - len , ' ' ) ; int NB = 11111 ; if ( Tag . cmplxf ) NB += 2 ; std :: string byt = Gdec ( NB ) ; len = byt . length ( ) ; ostr << " " ; ostr << byt << std :: string ( 10 - len , ' ' ) ; ostr << " " ; fp . seekp ( pos ) ; }
____________________________________________________________________________
B                MATLAB MAT 4 Data Element Access Functions
____________________________________________________________________________
____________________________________________________________________________ B MATLAB MAT 4 Data Element Access Functions ____________________________________________________________________________
// Input                ML4DE	: MAT version 4 data element (this) //                      ostr    : An output stream //			fp	: A file stream // Output               ostr    : Output stream with MATLAB MAT file //                                data element version 4 info placed //				  into it in MATLAB "whos" fashion // Note                         : It is assumed that fp points to the //                                beginning of a data element and that //				  it is open for reading. // Note				: The file stream position will be //				  advanced to the end of the element // No output if no filestream // Get current file position // Read data element tag // Read array name sub-element // Start new line & output margin // Get array name length // Output the array name // within the 9 columns in whos // output allocated for it // Output a spacer // String for dimension output // Get string length // Output dimensions // Get the bytes // sosi still need byte count set right // Twice a many if complex // Set bytes in string form // Length of bytes string // Output a spacer // Output the bytes // Output a spacer //  ostr << AF.SClass();			// Ouput the MATLAB class type // sosi still need class set right // Set original current file position