home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / progut~1 / iostream.zoo / include / fstream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-22  |  1.7 KB  |  55 lines

  1. //    This is part of the iostream library, providing input/output for C++.
  2. //    Copyright (C) 1991 Per Bothner.
  3. //
  4. //    This library is free software; you can redistribute it and/or
  5. //    modify it under the terms of the GNU Library General Public
  6. //    License as published by the Free Software Foundation; either
  7. //    version 2 of the License, or (at your option) any later version.
  8. //
  9. //    This library is distributed in the hope that it will be useful,
  10. //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. //    Library General Public License for more details.
  13. //
  14. //    You should have received a copy of the GNU Library General Public
  15. //    License along with this library; if not, write to the Free
  16. //    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. #ifndef _FSTREAM_H
  19. #define _FSTREAM_H
  20. #ifdef __GNU_G__
  21. #pragma once
  22. #pragma interface
  23. #endif
  24. #include <iostream.h>
  25. #ifdef OLD_STDIO
  26. #include <filebuf.h>
  27. #endif
  28.  
  29. class ifstream : public istream {
  30.   public:
  31.     ifstream();
  32.     ifstream(int fd);
  33.     ifstream(char *name, int mode=ios::in, int prot=0664);
  34.     void open(char *name, int mode=ios::in, int prot=0664);
  35.     void close();
  36.     filebuf* rdbuf() { return (filebuf*)_strbuf; }
  37. };
  38.  
  39. class ofstream : public ostream {
  40.   public:
  41.     ofstream();
  42.     ofstream(int fd);
  43.     ofstream(char *name, int mode=ios::out, int prot=0664);
  44.     void open(char *name, int mode=ios::out, int prot=0664);
  45.     void close();
  46.     filebuf* rdbuf() { return (filebuf*)_strbuf; }
  47. };
  48.  
  49. //class fstream : public iostream {
  50. //  public:
  51. //    ofstream(char *, enum open_mode);
  52. //};
  53. #endif /*!_FSTREAM_H*/
  54.  
  55.