Back to index

See source file

CDataStream.h

 
//----------------------------------------------------------------------------- 
//  $Header$ 
// 
//  COOL Program Library   
//  Copyright (C) CERES collaboration, 1996 
// 
//  Declaration of class ... 
// 
//----------------------------------------------------------------------------- 
#ifndef CDATASTREAM_H 
#define CDATASTREAM_H 
 
#include "fstream.h"  
#include "cool.h"  
 
class Cifstream : public ifstream {  
 
public:  
  //  Cifstream();  
  //  ~Cifstream();  
  //  Cifstream(const Cifstream &);  
  //  Cifstream & operator = (const Cifstream &);  
 
public:  
  Cifstream() : ifstream() { } 
  Cifstream(int fd) : ifstream(fd) { } 
  Cifstream(int fd, char *p, int l) : ifstream(fd, p, l) { } /*Deprecated*/ 
  Cifstream(const char *name, int mode=ios::in, int prot=0664) 
    : ifstream(name, mode, prot) { } 
  void open(const char *name, int mode=ios::in, int prot=0664) 
  { ifstream::open(name, mode, prot); } 
 
public:  
  void read(char *, int);  // read bytes and convert little <-> big endian 
//  
//     istream& read(unsigned char *ptr, streamsize n) 
// 	 { return read((char*)ptr, n); } 
//     istream& read(signed char *ptr, streamsize n) 
// 	 { return read((char*)ptr, n); } 
//     istream& read(void *ptr, streamsize n) 
// 	 { return read((char*)ptr, n); } 
 
};  
 
class Cofstream : public ofstream {  
 
public:  
  //  Cofstream();  
  //  ~Cofstream();  
  //  Cofstream(const Cofstream &);  
  //  Cofstream & operator = (const Cofstream &);  
 
public:  
  Cofstream() : ofstream() { } 
  Cofstream(int fd) : ofstream(fd) { } 
  Cofstream(int fd, char *p, int l) : ofstream(fd, p, l) { } /*Deprecated*/ 
  Cofstream(const char *name, int mode=ios::out, int prot=0664) 
    : ofstream(name, mode, prot) { } 
  void open(const char *name, int mode=ios::out, int prot=0664) 
  { ofstream::open(name, mode, prot); } 
 
public:  
  void write(char *, int);  // convert little <-> big endian, then write 
 
//    ostream& write(const char *s, streamsize n); 
//    ostream& write(const unsigned char *s, streamsize n) 
//	{ return write((const char*)s, n);} 
//    ostream& write(const signed char *s, streamsize n) 
//	{ return write((const char*)s, n);} 
//    ostream& write(const void *s, streamsize n) 
//	{ return write((const char*)s, n);} 
 
};  
 
#endif /* CIDATASTREAM_H */  
 
 

Back to index

See source file