1/* This is part of libio/iostream, providing -*- C++ -*- input/output. 2Copyright (C) 1988, 1992, 1993 Free Software Foundation 3 written by Doug Lea (dl@rocky.oswego.edu) 4 5This file is part of the GNU IO Library. This library is free 6software; you can redistribute it and/or modify it under the 7terms of the GNU General Public License as published by the 8Free Software Foundation; either version 2, or (at your option) 9any later version. 10 11This library is distributed in the hope that it will be useful, 12but WITHOUT ANY WARRANTY; without even the implied warranty of 13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14GNU General Public License for more details. 15 16You should have received a copy of the GNU General Public License 17along with this library; see the file COPYING. If not, write to the Free 18Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 20As a special exception, if you link this library with files 21compiled with a GNU compiler to produce an executable, this does not cause 22the resulting executable to be covered by the GNU General Public License. 23This exception does not however invalidate any other reasons why 24the executable file might be covered by the GNU General Public License. */ 25 26#ifndef _SFile_h 27#ifdef __GNUG__ 28#pragma interface 29#endif 30#define _SFile_h 1 31 32#include <fstream.h> 33 34extern "C++" { 35class SFile: public fstream 36{ 37 protected: 38 long sz; // unit size for structured binary IO 39 40public: 41 SFile() : fstream() { } 42 SFile(int fd, int size); 43 SFile(const char *name, int size, int mode, int prot=0664); 44 void open(const char *name, int size, int mode, int prot=0664); 45 46 int size() { return sz; } 47 int setsize(int s) { int old = sz; sz = s; return old; } 48 49 SFile& get(void* x); 50 SFile& put(void* x); 51 SFile& operator[](long i); 52}; 53} // extern "C++" 54 55#endif 56