home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / g__inc / xfilebuf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-23  |  2.0 KB  |  68 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2. /* 
  3. Copyright (C) 1988 Free Software Foundation
  4.     written by Doug Lea (dl@rocky.oswego.edu)
  5.  
  6. This file is part of the GNU C++ Library.  This library is free
  7. software; you can redistribute it and/or modify it under the terms of
  8. the GNU Library General Public License as published by the Free
  9. Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.  This library is distributed in the hope
  11. that it will be useful, but WITHOUT ANY WARRANTY; without even the
  12. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  13. PURPOSE.  See the GNU Library General Public License for more details.
  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 Software
  16. Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18.  
  19. #ifndef _Filebuf_h
  20. #ifdef __GNUG__
  21. #pragma once
  22. #pragma interface
  23. #endif
  24. #define _Filebuf_h 1
  25.  
  26. #include <xfile.h>
  27. #include <streambu.h>
  28.  
  29. class Filebuf: public streambuf // libg++ File version
  30. {
  31. public:
  32.   File*       Fp;
  33.  
  34.   void        init_streambuf_ptrs();
  35.  
  36.   int         overflow(int c = EOF);
  37.   int         underflow();
  38.  
  39.               Filebuf();
  40.               Filebuf(const char* filename, io_mode m, access_mode a);
  41.               Filebuf(const char* filename, const char* m);   
  42.               Filebuf(int filedesc, io_mode m);
  43.               Filebuf(FILE* fileptr);
  44.   
  45.              ~Filebuf();
  46.  
  47.   const char* name();
  48. #ifdef atarist
  49.   streambuf*  setbuf(char* buf, size_t buflen, size_t preloaded_count = 0);
  50. #else
  51.   streambuf*  setbuf(char* buf, int buflen, int preloaded_count = 0);
  52. #endif
  53.  
  54.   streambuf*  open(const char* name, open_mode m);
  55.   streambuf*  open(const char* filename, io_mode m, access_mode a);
  56.   streambuf*  open(const char* filename, const char* m);
  57.   streambuf*  open(int  filedesc, io_mode m);
  58.   streambuf*  open(FILE* fileptr);
  59.  
  60.   int         is_open();
  61.   int         close();
  62.  
  63.   void        error();
  64. };
  65.  
  66.  
  67. #endif
  68.